Skip to main content
M_71
Participant
May 15, 2015
Question

Illustrator Scripting Help

  • May 15, 2015
  • 1 reply
  • 600 views

Hi I am in need of some suggestion and scripting help if possible please. 

I work for a signage manufacturing company ( we design and construct signs ranging from banners to illuminated letters / logos you'd see on buildings to full size pylons with tenant panels and graphics ) as a graphic designer.  I'm looking to create a script that will run automatically every time a file is opened and search the document for a keyword or I was thinking perhaps a layer with a specific name that we would create, and when it is found have an alert box pop-up with text appear.  If it is not present then the script would end without doing anything. 

The objective of the script is to provide notice and stop our production team from using graphics, logos, or text that is not official or approved by our client.  Our production team works off the files we save on our server and this script would serve as notice to them that this job cannot go further without proper artwork.

I am not familiar with scripting, I was hoping I might find something online or close enough to what I would need with just some minor changes but I wasn't that lucky.  I have made some attempts but they don't work.  Here is what I have so far:

// Find the Layer

{ var layerString="ARTWORKREQUIRED";

alert("This file is NOT production ready, proper artwork is required.")

}

I saved the script into a folder I created in 'Applications/Illustrator/Startup Scripts/' and saved it as 'ArtworkRequired.jsx'  Please any suggestions or help with this script would be greatly appreciated!  Going about it this way, I think I would have to place that script locally for all macs on our network, but that's ok by me we just need it to work!

We are using CS3 in a pc / mac environment, but only the macs access the Illustrator files.

Matt

This topic has been closed for replies.

1 reply

Qwertyfly___
Legend
May 15, 2015

your fist issue is the start up folder.

this will only run the script when illustrator starts.

so if your designer does not close illustrator then it will not activate correctly.

would it not be simpler to have a "stamp" you could add to say APPROVED to the art sheet?

Silly-V
Legend
May 15, 2015

Ya know, if I ever got into doing a plugin, my very first project would be to make an ultra-simple (not sure how really simple this would be) plugin which would just give you basic event awareness for running custom scripts. For example, when a file is saved, your custom script will run (say there is a folder for each of the events, with names like "onStartup", "onClose", "onSave", "onExport", etc. This would help out with this kind of thing. But, the thing with plugins is that they are varied in platform and version even worse than scripting is, from what I hear.

For this kind of task, I'd probably see if it's possible to have a script activation panel which has all the same functions (Save As..., Open...) do an extra thing that needs to be done, such as looking for a flag keyword. Then try to convert all the employees to use it and remember using it, if that's even workable.

M_71
M_71Author
Participant
May 15, 2015

Thanks for the input, I appreciate it.

Silly- a script activation panel would likely work but we want something that is automated so its not open to people forgetting to run the actions or scripts to catch the flagged files.

A good idea going forward and one we can implement now (thanks Qwertyfly ) is duplicating the art on a separate layer and rasterizing it with a watermark to get the attention of our production guys and hiding and locking the vector art layer that would be needed for production. 

That would do it, its an extra step we would have to take in design but there's no reason that wouldn't work.  Ideally, in my perfect world I want a script to do the work.  Does anyone know of a script loop perhaps that would continually run or be active in the background while Illustrator is open and apply itself to the 'active window' or session of Illustrator currently in use? 

Also, perhaps instead of a keyword the script would run based on the location of the file, since all our files are stored on a central server it would run on all our files, with the script requirements for running being: run the script when file location = servername/design/designfiles/...'  or something like that?

I'm not sure, just another thought.