Skip to main content
Known Participant
August 14, 2009
Question

Automate Loading of Transparency Flattener Preset

  • August 14, 2009
  • 2 replies
  • 1184 views

For a project I'm working on we need for our users to have a particular transparency flattener preset loaded. I'm not finding a way to load it ahead of time. I can verify if it's loaded, which is helpful:

tell application "Adobe Illustrator"
     set flattenerPresets to flattener presets

     if flattenerPresets does not contain "NameOfFlattenerPreset" then

          --do whatever magic is necessary to load the preset

     end if

end tell

Because of a bug in Illustrator I can't use UI scripting via AppleScript to automate the import. The issue here is that Illustrator doesn't respond to the "click" command properly when it comes to checkboxes and buttons.

Another option would be to just place a copy of the preset file into the proper location on the hard drive so that Illustrator sees it. Problem is, I can't seem to determine where that is. Adobe seems to be hiding it somewhere. I manually loaded a preset and then moved it from that location on the hard drive. I re-launched Illustrator and it still had the preset.

At this point I'm not sure how to automate the loading of this preset. Any and all suggestions would be greatly appreciated.

Thanks,

Stephan

Version Info:

Illustrator CS4

Mac OS X 10.5.8

This topic has been closed for replies.

2 replies

Muppet_Mark-QAl63s
Inspiring
August 17, 2009

I don't think its possible to load a preset from AppleScript. Can't your script just supply the flattening options at which ever point they are required?

tell application "Adobe Illustrator"

set This_Flatten to {class:flattening options, clip complex regions:true, convert strokes to outlines:true, convert text to outlines:true, flattening balance:100, gradient resolution:600, overprint:preserve, rasterization resolution:300}

end tell

Larry G. Schneider
Community Expert
Community Expert
August 14, 2009

Look in the HD>Users>yourname>Library>Preferences>Adobe Illustrator CS4 Settings> Transparency Flattener Settings. It's just a text file. You can add to it by using the Edit>Transparency Flattener Settings. Make a new setting to do what you want and quit AI so the preferences are saved. You should be able to exchange that file for the one in any other installation of AI.