Illustrator Scripting :: Change Folder Current To Location Of Script (JSX) File?

Jan 6, 2012

I'm trying to use some images in my ScriptUI dialog, but I want to use a "relative" path name, and I can't seem to get it to work.For example, this myScript.jsx works just fine, but as you can see, I'm using an "absolute" path name to transparencyGrid.jpg:
 
var w = new Window ("dialog");
var f = new File ('~/Desktop/transparencyGrid.jpg');
w.add ("image", undefined, f);
w.show ();
 
However, I want to be able to use a relative (to myScript.jsx) path to point at transparencyGrid.jpg, like this:
 
var w = new Window ("dialog");
var f = new File ('../../../transparencyGrid.jpg');
w.add ("image", undefined, f);
w.show ();
 
But, I can't seem to get this to work because relative paths seem to be relative to the current folder, Folder.current, not the location of the currently executing script.I say that because when I do this:
 
alert(Folder.current);
 
The only thing the alert message shows is a backslash (/), indicating to me that the current folder is the root of my OS, but I thought it would be the folder where myScript.jsx resides.
 
So, is there a way of setting Folder.current to the location of the actual script?

View 2 Replies


ADVERTISEMENT

Illustrator Scripting :: Change Script Folder Location?

Jan 23, 2014

Is it possible to change the location of where illustrator looks for scripts, or is it possible to add a location?

View 9 Replies View Related

Illustrator Scripting :: Choose Folder Default Location

Oct 5, 2012

Any way to allow a user to choose a folder from a default location. I thought I had found the solution but it's not quite working as I wanted:
 
#target illustrator

//Example 1
var output_folder = Folder.selectDialog ('Choose PDF output folder.');

//Example 2
var myFolder=Folder(app.activeDocument.path).selectDlg("Choose PDF output folder:");
 
If I use the code in example 1 the choose folder dialog appears and the 'Open' button is available and when I press the button the location is chosen as expected. However if I use the code in example 2, although the choose window opens in the path of the active documents location the 'Open' button is not able to be pressed until I select a folder., which means that the chosen location is not correct. I should indicate that I'm running this code on a Mac.
 
Any way to have a choose folder dialog window specify a location and be able to select that.

View 20 Replies View Related

Illustrator :: Action For Saving PDF To Current Location With Different File Name?

Feb 15, 2013

I'm working on building an action in Illustrator CS5 that will do the following..Delete the layer "original artwork"Select AllCreate OutlinesSave as PDF "content.pdf" to the current working folder with specific settings in the Save PDF prompt..Up to step 4 this is pretty simple, but so far when trying to record the saving step it insists on using the directory that I'm building the action in - not the relative one based on where the current file is opened. Also, unlike the 'Save For Web JPEG' default Illustrator action, the PDF saving step doesn't retain any of the specific settings within the action.

View 2 Replies View Related

Illustrator Scripting :: Save File On Remote Location

Oct 8, 2012

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)

View 7 Replies View Related

Illustrator Scripting :: Change File Path For Links In Document?

Apr 14, 2010

changing the file path for links in an Illustrator document?
 
For example, let's say my Illustrator document is stored at: /Volumes/Storage/Projects/Client/AAA001/designs/concept1.ai
 
and I have placed 2 linked visuals:
 
/Volumes/Storage/Projects/Client/AAA001/visuals/big_retouch.psd
/Volumes/Storage/Projects/Client/AAA001/visuals/flattened.jpg
  
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.)

View 11 Replies View Related

AutoCad :: Change Folder Location By Command

Nov 25, 2013

I would like to know if it is possible by command to change file/folder location that are normally set up in the OPtions>Files tab.

I would like to know because everyone in the office uses a specific LISP routine on which i set some standard settings.

I would like to be able to change/add/delete file locations of the 'Tool Palettes File Location' and the 'Default Template File Name for QNEW'.

View 1 Replies View Related

Edge Animate CC :: Get Current Label In Timeline From Current Location

Jun 5, 2013

I have 1 Next button that is used on the timeline.  Each position has a pause then a play so there is only 1 button.  I need to get the label info so I know where I am so I can save the location of the timeline that the user was at if they exited before they finished the process.

View 6 Replies View Related

Illustrator Scripting :: How To Center Current Selection To Artboard

Feb 17, 2014

how do I center my current selection to the artboard? just like hitting the "horizontal align-center" and "vertical align-center" buttons. I've been searching for the last two hours and before my head hits the keyboard.
 
What I'm struggling with: in my init function i create a new document and then copy all layers from the previous document step by step to the new document and then save it as SVG.
 
// Init
(function(){
          destination = Folder.selectDialog('Select folder for SVG files.', docPath);
          if (!destination){return;}
          holderDoc = app.documents.add();
          stepThroughAndExportLayers(docRef.layers);
}());
 
my problem is that holderDoc = app.documents.add(); always creates a document that is not the same size as my initial document where the layers get copied from.
 
so I want the exact same artboard size as in my initial document.I'm fine with either doing it as fixed values or taking directly the values of the inital doc. i tried this in the segment where I create the new document:
 
// Init
(function(){
  destination = Folder.selectDialog('Select folder for SVG files.', docPath);
  if (!destination){return;}
  holderDoc = app.documents.add();
  holderDoc.artboards[0].artboardRect = [0,0,128,128];
  stepThroughAndExportLayers(docRef.layers);
}());
 
and get this error message: "Error 1200: an Illustrator error occured: 1346458189 ('PARM')

Line: 83
-> holderDoc.artboards[0].artboardRect = [0,0,128,128];"
 
which from what I've read on the web means that illustrator doesnt know what document to pick. but i have called it directly. I do not want to fit the artboard to the images/layer. the artboard should always have a certain size. (for me 128px by 128px)
 
// edit: workaround
(function(){
          destination = Folder.selectDialog('Select folder for SVG files.', docPath);
          if (!destination){return;}
          var activeArtboard = app.activeDocument.artboards[app.activeDocument.artboards.getActiveAr tboardIndex()];
          var ABRect = activeArtboard.artboardRect;
          holderDoc = app.documents.add();
          holderDoc.artboards.add(ABRect);
          holderDoc.artboards.remove(0);
          holderDoc.artboards.setActiveArtboardIndex(0);
          //stepThroughAndExportLayers(docRef.layers);
}());
 
i now added a new artboard to the new document with the same size as the artboard on the initial document.i remove the predefined artboard on the new doc and set the new artboard as active the artboard is now not centered into the window. which lets illustrator place my image with ctrl+c -> ctrl+v somewhere outside the artboard.
 
i now need to align my selection to the center of the artboard. but i cant find any reference on how to center a selection to the artboard.

View 7 Replies View Related

AutoCAD Inventor :: Change Location Of The Import Folder?

Mar 6, 2013

Trying to make it where I wouldn't have to deal with the idiosyncrasies of the Project file, I created a default project that was rooted to my top level network drive.

All was fine until I did some importing from other formats.  All of the sudden there was a new top level network folder called imports.

Ok, bitch session aside on the uselessness of project files, is there an entry in the project file details where I can change the location of this folder?

In SW, I was accustomed to importing a file and then saving it where I was going to use it, not in some convoluted folder structure that had no relation to my active working location.

I mean, why on earth would I want a separate folder for every little part I import?

View 3 Replies View Related

Illustrator Scripting :: How To Check Color Profile For Current Document

Oct 16, 2012

I'd like to create a script that checks the current document's color profile and checks it against a string, for example "sRGB IEC61966-2.1". My studio has a script that performs various functions to make sure that all the layers are visible/unlocked, checks for stray points, etc., and we'd like to add a check to the color profile because we handle a large number of files and this setting is overlooked a lot.
 
It's alright if this value isn't writable through script (we can just pop up an alert letting the user know that they need to change it), but I can't find where to actually read this setting! We're currently working on Macs and with JavaScript, but any nudge in the right direction.

View 11 Replies View Related

Illustrator Scripting :: JavaScript To Send Selected TextFrame To Current Layer?

Feb 20, 2013

Is there a way to send a selected textFrame item to a layer using javascript?
 
I don't mind if it is send to current layer or some other way to accomplish the task.
 
(Using Adobe Illustrator CS4)

View 5 Replies View Related

Illustrator Scripting :: Save Document On Network Location

Sep 19, 2012

I am working on a plugin application, in that saving Image files on a specific location by using JSX file.I have done with that but it works only with local drive.I want to save that file on my Network Share by using JSX.

View 10 Replies View Related

Illustrator Scripting :: How To Get Location Of Horizontal And Vertical Guides

May 17, 2013

How do I get the location of horizontal and vertical guides?
 
I'm halfway through by using some calculations on geometric bounds and subtracting it from the document height but can't I just do something like
 
nextGuide =mydoc.guides[x].location;
 
Also, why does it seem that Indesign scripting has more access to properties and methods?

View 5 Replies View Related

Illustrator Scripting :: Create JS Script To Move Objects Away From Common Center Based Upon Their Current Position

Jan 17, 2014

I was hoping to create a JS script to move objects away from common center based upon their current position. I was thinking to use a single selected path item as the center based on its position x/y and width/height. Using this reference point the script would then move away all other path items from this center point based on a desired amount and with uniform increments given their current location from this center. I was thinking cos and sin would be my friend in this case, however they seem to have become my foe instead. ;-)
 
Does this sound doable? What am I missing, doing wrong, misinterpreting? Below is a non-working attempt, I can't seem to sort things out, perhaps I was close and missed it or maybe I am super way off and its more complex than I thought. However at this point I am confused across my various failed attempts this only being one of them. 
 
// Example failed code, nonworking concept
var docID = app.activeDocument;
var s0 = docID.selection[0];
pID = docID.pathItems;
var xn, yn;
var stepNum = 20;

[Code]....

View 13 Replies View Related

Illustrator :: Remember Last Folder Location Lost With Mac Lion Updates

Mar 12, 2013

Since Lion or Mountain Lion, we have had an annoying problem where the last folder location is not remembered in Illustrator. For example when updating links on multiple files, would like for the folder location to return to the last one used, but this would go to some folder 3 levels higher/
 
URL....Also the software seems to not have bneen updated in a long time, adn don't wnat a solution that won't last.  Am on 10.8.2.

View 11 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Set File Location From Shared Dropbox Folder

May 10, 2012

I would like to put our company programming on a Dropbox folder.  I have not fully tested everything out yet, like locations of lisp files and image name...

One thing I am struggling with is an absolute path in my lisp file:

(setq FL:FLAYTAB "C:\Users\dvanerem\Dropbox\Canova and Stone\Customizations\Autodesk AutoCAD 2010\Programming\OENV-RCP.TAB")(FL:LoadTable)

I am confused how this would work with other users? Or does AutoCAD automatically correct for this? 

View 2 Replies View Related

Illustrator Scripting :: Why Won't Script Work On All Files In Folder

Jun 13, 2013

It is supposed to change hyphens to en-dashes in a ai files in a folder. However, when I run it, it only works on one file. After it makes the change and closes the first file, it stops.

var destFolder, sourceFolder, files, fileType, sourceDoc, targetFile, pdfSaveOpts;
sourceFolder = Folder.selectDialog;
if ( sourceFolder != null )
{
    files = new Array();
    fileType = "*.ai";
    files = sourceFolder.getFiles( fileType );
    if ( files.length > 0 )
[code]....

View 6 Replies View Related

Illustrator Scripting :: VBscript To Edit All Drawings In A Folder?

Mar 19, 2013

I have some +900 legacy pdf's that need to have a title and date change. The pdf's where generated in ArcMAP 10 so the text appears as individual letters. So I wrote a script that creates a knockout and adds the required text. I can get this to work for an individual file but I can't figure out is how to have the script perform it for all the pdf's in a folder.
 
Set appRef = CreateObject("Illustrator.Application")
Set docRef = appRef.Open("C:WorkCity_Wide_Zoning�_Spring_2013TestA001.pdf")
' *************************
'Knockout

[Code]....

View 4 Replies View Related

Illustrator Scripting :: Open SVGs In A Folder And Save Them To One Multipage PDF

Mar 24, 2012

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.
 
How many files I could put in 1 pdf this way?
 
I'm using Illustrator CS5 on Win7 x64.

View 7 Replies View Related

Illustrator Scripting :: Set Folder As Relative Path To Where Script Is Running?

Apr 10, 2012

How do I set a folder as a relative path to where the script is running?

is there any easy way like in unix, starting without / ?or for example
 
"~/Desktop/"
 
"/users/<login>/desktop/"
 
seems that path to me is the only way...
 
is there an easy way to change posix paths to applescript??
 
I have this code:
 
tell application "Finder" to set templateFile to (container of (path to me) as string) & "Graficas FINAL ADQAT.ai"
 
with this error: error "No se ha encontrado el archivo Macintosh HD:Users:Vibra:Desktop:Graficas FINAL ADQAT.ai." number -43 from "Macintosh HD:Users:Vibra:Desktop:Graficas FINAL ADQAT.ai"
 
the file is there how I change the filepath to be compatible with applescript?

View 3 Replies View Related

Photoshop Elements :: Open Folder Location / Image Displayed Are Not In Highlighted Folder

Jul 27, 2013

When I open Elements 9 in Folder Location the images displayed are not those in the highlighted folder.  Similarly if I select another folder I see another selection of images from elsewhere in the structure. 

View 1 Replies View Related

Photoshop Elements :: Folder Location And Click On A Folder Doesn't Display Any Pictures

Dec 9, 2012

I'm new to Elements 10 and I'm having a hard time figuring things out but 1 thing in particular.  I'm on a PC and use Windows 7.I already import a lot of pic's to Elements or so I thought.
 
When I'm in  "Folder Location" and click on a folder it doesn't display any pictures and says "No files from this folder have been imported into Elements Organizer. To add any files, right click on the folder and select "Import to Organizer"
 
So I do as I'm told and then i get this error."Nothing was imported. The files or folders selected to import did not contain any supported file types or the files are already in this catalog."

View 2 Replies View Related

Illustrator Scripting :: Action To Batch Export Folder Of AI Files To Create 300dpi PNG

Oct 3, 2011

I created an Action to batch export a folder of .ai files to create 300dpi .png's of the .ai file's artboard. I did this by simply recording "Export...as png" with my desired settings then Batch running the Action on desired folder of .ai files.  The files were successfully exported, the trouble is that the exported files lack a .png file extension. My intent is to take these PNG files and merge them into a single PDF using Acrobat Pro. Unfortunatly, without the .PNG extension, Acrobat Pro does not recognize the file types and does not let me use the Combine Files feature on them. Going back and manually adding a .png at the end of the exported files defeats the time-saving purpose of Batch Processing all together. Is there something I am missing or doing incorrectly? I have included screenshots of 1) My Batch Action settings 2) folders showing files without .png extension and 3) visual of what I see when I am trying to combine PNGs into a PDF.

View 4 Replies View Related

Illustrator Scripting :: Adding Serial Numbers Apply To Multiple Files In Selected Folder?

Dec 19, 2011

How to make the following script for adding serial numbers apply to multiple files in a selected folder?
 
var docRef = app.activeDocument;
with (docRef) { 
var docName = name.substring(0, name.lastIndexOf('.'));
var artRight = visibleBounds[2];

[Code] .....

View 6 Replies View Related

Photoshop :: Change The Default Location For File

Dec 23, 2012

When I click on File, Open in CS2 (it came with the computer) Pictures is always the Library that opens. Can this be changed? I have created a Library called Photography. That is where I download and store my photographs and where I work on them.

View 3 Replies View Related

Illustrator Scripting :: Apply Current Fill Color To Stroke Then Adjust That Stroke Color's Build?

Apr 9, 2013

I'm trying to figure out a way to automate a simple, yet repetative process I do countless times a day. Ideally, I'd like to tie it to a keystroke to speed up my workflow.
 
I work on line art and colorways for footwear, so the way I'm coloring these shapes and strokes break apart the different materials and pieces of the shoe.
 
While coloring line art, I work with Pantone spot colors as fills for closed path objects. I then have to manually apply that same color to the stroke, set the stroke to 0.5px weight, convert that spot stroke color to CMYK, and add 15% to the K value.
 
I found some code in an older post for applying the actively selected object's fill color to the stroke, but I'm having but I'm having trouble with the next step of figuring out how to take that spot stroke color and convert it to a CMYK build that I can then add 15% black to. Is this something that's even possible? I've spent about an hour playing with the script and have only had luck matching the fill color or turning the stroke white.

View 13 Replies View Related

AutoCAD .NET :: Current Drawing Location Path

Apr 29, 2011

I am using vb.net and I need to find the directory path that my current or open drawing is located in.  I'm not sure how to get this from vb.net. 

View 4 Replies View Related

AutoCAD 2013 :: Tool Palettes - Change Source File Location?

Oct 14, 2013

Due to circumstances beyond my control the directory path that my tool palettes are mapped to needs to be changed.

From:    T:Toolpalettesetc...

To:        X:Toolpalettesetc...

I have hundreds of blocks in the tool palettes that are looking for their source file on the "T" drive.

My brain says "Find / Replace T: with X: " using Notepad in all of the ATC files.

Is there a better method to tell those blocks to look on the "X" drive?

View 2 Replies View Related

Illustrator Scripting :: Change Values In Action

Sep 13, 2012

I frequently record Illustrator Actions. My actions are quite long, but they all involve three common steps:
 
-Assigning Notes to shapes   
-Assigning Swatches to shapes   
-Selecting shapes that have a specific notes 

I often need to re-record my actions to repeat all the steps, but to change the notes/swatches that are selected/assigned during the action.
 
Illustrator has a re-record command. This command is great for changing the value of the note in number 3 of my list. However, it does not work for items 1 & 2 in my list. For these items I have to delete the old step in the action and then record a new step with the new swatch/note.
 
I know macros in Microsoft Office have an editor which allow you to change values in actions. Is there anything similar for Illustrator actions?You can save an Illustrator action and open it in Text Edit. However, all the attribute/swatch values are saved as weird strings, so I don't know how to change them.

View 4 Replies View Related

Illustrator Scripting :: Color Change To Various Types?

Feb 6, 2013

I am trying to change the color of all items on and under a specific layer.I have been successful changing the color of specific types of objects (paths), but I need to accommodate all the types on the layer and sub layers.
 
I can recurse to as many sub layers as I expect, but how do I accommodate the page Items, path Items, group Items, compound Path Items, etc.I was thinking of pushing everything to an array, but I have no experience with arrays...

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved