Illustrator Scripting :: Open Save File Dialog With Default Path
Oct 8, 2012
I want to open a "Save File Dialog " with some default path.Like when user run that script I want to open a "Save As" dialog box with default path "/Volumes/<shared name>/<folder name>/.. ."I am using File.SaveDialog(prompt, filter);
but it doesn't open to the location by default that I want to open.
So I deal with a lot of files each day that need to be saved according to their lead code, meaning that there is a folder that holds thousands of sub folders that have the same name as this lead code on a server.
So since I have the lead code in the file name I'm trying to use that in conjunction with the file path to tell illustrator where to save it with Javascript. Also the idea of a dynamic save path is useful.
Here's what I've got so far, it's not working yet but I feel like I'm close.
/*///////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// Dynamic Save Path//////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////*/ #target illustrator
I am just trying to save a PDF from my illustrator file. However, when I go to Save as, and select PDF, no dialog box opens to allow me to set how I want the file outputted. IF I just hit enter, the file does save.. its just like the Dialog box is hidden or not appearing. The reason I need the dialog box is because I need to add bleeds to the PDF and my default save doesn't do that.
I'm batch exporting JPGs of AI files in CS5, but many of the files are as old as AI10, so I'm getting the "Convert to Artboard" dialog box. I've set open options (below), but they seem to just pre-populate the checkboxes in the dialog. Any way to do this without user interaction? userInteractionLevel doesn't seem to apply here)
var optRef = new OpenOptions(); optRef.updateLegacyText = true; optRef.convertCropAreaToArboard = false; optRef.preserveLegacyArtboard = true; optRef.createArtboardWithArtworkBoundingBox = false;
I'm having a problem throught CS6 with the Open, Save, or Save As dialog boxes not opening for a period of time after clicking on the desired functions. It can take over a minute just to get the Open dialog box up to browse for a file. Eventually, the dialog boxes open, but during the time that it's trying to open, the program is unresponsive. It is happening with all of my CS6 programs. I have unistalled and reinstalled with no fix. The programs are updated.
I used to be able to save as and browse to the file where I want to sane or open a file
Now I get a dialog box where I can only save to the default location or manually enter the path and file name
Same with opening a file - I go file open and it is gives a path to the last file I used. There is option to browse - how I get this back to the normal function of open/save by browsing?
I'm new to scripting What I want to do and don't know how to go about it is to run a script that collects the saved file name and the full path where the file is saved on the network and displays it on my document.
I'm using Illustrator for work and I love it, I never needed scripts yet. Now I have couple houndred svgs coming in per day, I would like to have a script that opens every svg one by one in the selected directory and add them to a pdf as pages of the same size and than save it.
When I open the .AI I noticed that the reference to the visuals is under a %DocumentFiles section: %%DocumentFiles:/Volumes/Storage/Projects/Client/AAA001/visuals/retouc hed.psd %%+/Volumes/Storage/Projects/Client/AAA001/visuals/flattened.jpg
I need to replace "/Volumes/Storage/Projects" with "/Volumes/Projects". (There are some more complex replacements I need, but let's start here.)
Is there a way with JavaScript to place an image with a calculated path and file name? I have 30+ artboards per document, each artboard named by product number. The actual file name of the master AI file is also already established (meaning every document I use this new script on will have already been saved).
Here's the scenario I'm hoping to create in the context of the documents mentioned above:
Run a script to "Place" a linked image based on the following calculated path:
["S:SAPCurrent Images in SAPStock Schools"] + [current ai filename minus the .ai extension]+[a hyphen like this "-"]+[currently selected artboard name]+[".jpg"]
This image link can be placed on a new top layer called "Images" or if necessary on the currently selected layer. Dimensions of the placed image should be a pre-determined size 8"x8".
I have several Illustrator JavaScripts that I've written with the ESTK. A lot of these scripts involve resizing the artboard or artwork to specific sizes. Instead of forcing the user to manually input the dimensions they want into text fields, I just stored a half-dozen or so "presets" in an array.
Then they can select one of the presets from a dropdownlist, or go ahead and input a custom size. These presets are the same for multiple "resize" scripts, so it would be nice to store those presets in a separate file (i.e. presets.jsx) that my resize scripts could reference, so when I need to add or change a preset, I could just go to that one shared file, and all the scripts would be updated.
Is it possible to do that? If it is, a quick example of how to load the variables from another file.
I want to save Current open Document on remote location (on server).
I am able to save it on my local machine(the machine i am presently working on).
Now I want to save it on some remote server.
I am using following code for that:
var doc=app.activeDocument(); var aiSaveOptions1=new IllustratorSaveOptions(); var aiFile1 = File( '/osn-pc-16/adobe/1/Original.ai' ); doc.saveAs(aiFile1,aiSaveOptions1)
When I open a PDF file I get the following warning:
The document contains PDF objects that have been reinterpreted.
- The font is missing
Can I somehow open the file without showing that error, or simply automate and click OK on that window? I am using C# with COM reference. See code below:
var iapp = new Illustrator.Application(); var idoc = iapp.Open(file, Illustrator.AiDocumentColorSpace.aiDocumentRGBColor, null);
var doc = app.activeDocument; var destFolder = Folder ("~/Documents");
if (destFolder) { var fileName = activeDocument.name; var destFile = new File(destFolder + '/' + fileName);
[Code] .....
This code I created exports my current Ai document as a PSD with set options. It also names the new file what it is called in Ai.
How can I call the created file and open it directly in Photoshop? Keep in mind I would be working on multiple files, so file names would change every time I ran this Export Script.
I could call a specifically named file and open that, but that's not what I need this script to do. I just need it to open the newly created PSD file.
I created a circle and positioned a line segment on top of it. When I preview or save the image, the line segment doesn't appear. Here is an illustration of the problem.
When saving a TIFF file on Adobe PSCS6, the "Save" dialog box always defaults the byte order to MacIntosh rather than IBM PC even though I am using a PC. I have checked Edit>Preferences but can't find an adjustment for this. Do I have to just live with it?
How do I save an illustrator cc file to open in cs6? I get an error when I send the file to a colleague and they cant open it.It doesn't give me any options.
After finally getting X6 to be stable and usable I have two things I'd like to mention..
First, I've been using a 3rd party file manager called Ztree for years and one of its most wonderful capabilities is to copy paths to the clipboard which alleviates opening/saving frustrations with the typical Windoze Explorer dialogs. Anyway, one of the first problems I noticed with X6 is that Paste no longer works in the Open Drawing dialog, while it worked just fine in X5 and as far as I can remember, all previous versions. I sure would like to get that back.
My second complaint is the File/Export routine and specifically the presets. I do a lot of exporting to PNG and JPG and use multiple presets for fixed size/print resolution image output in both file formats. During the typical export session, I essentially export multiple different drawings all of which are exactly the same size/resolution in CD and in the past (X4 and prior as I recall,) was able to just hit <Enter> when the Export dialog appeared once the preset was set to the one I needed for that session.
In X6 though (and to some degree in X5,) even though the correct preset is listed, CD doesn't appear to recognize it, i.e., the math for the size/dpi conversion doesn't take place which forces me to waste time selecting "Original" or some other preset first, waiting for CD to render the new version, and THEN selecting the conversion preset that was pre-selected when I first opened the export dialog.
when i go to open or save a file in illustrator, the pop up box will only last 2 seconds? i just recently installed the new maverick osx but it was working fine yesterday.
I have very simple dialog - just one panel and few checkboxes. When I set panel as "undefined" everything works right, but when i set a size of the panel checkboxes disappear.
Works var win = new Window ("dialog", "test"); var panelOpcje = win.add("panel", undefined, "Options"); var check1 = panelOpcje.add("checkbox", undefined, "check1"); var check2 = panelOpcje.add("checkbox", undefined, "check1"); win.show();
This doesn't work var win = new Window ("dialog", "test"); var panelOpcje = win.add("panel", [0,0,400,300], "Options"); var check1 = panelOpcje.add("checkbox", undefined, "check1"); var check2 = panelOpcje.add("checkbox", undefined, "check1"); win.show()
how to show the color picker dialog in Illustrator programmatically?
In photoshop that's really easy, just:
app.showColorPicker(true);
In Illustrator I couldn't find any reference to such a method or other possibility to show the dialog programmatically, that you would normally get when double clicking on the fill color square within Illustrator.
Is that possible by using app.executeMenuCommand or some other method?
I am writing a script that opens the color picker dialog in reaction to a click on a button. I want to be able to get the chosen color and use it within the script.