Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

Script execute Action?

New Here ,
Sep 19, 2008 Sep 19, 2008
How in gods name do you execute a Action with a script?

I found this is sometimes easier than trying to script my copy paste crazyness. The illustrator script docs say, oh you can call a action, but they don't say how! I am going crazy...
TOPICS
Scripting
2.8K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
New Here ,
Sep 19, 2008 Sep 19, 2008
Michael, Im new to learning JavaScript but I can't find any reference to this in the guide. In AppleScript its the "do script" command. You supply 2 strings one the name string of the action second name string of the containing set with a dialog boolean. Sorry but I don't know enough to try translate this or even if its not possible. Example is like this:

tell application "Adobe Illustrator"
set Doc_Ref to the current document
tell Doc_Ref
repeat with i from (count of group items) to 1 by -1
set selection to group item i of layer 1
do script "UnGroup" from "Marks" without dialogs
end repeat
set selection to {}
end tell
end tell
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 19, 2008 Sep 19, 2008
I didn't try this, but maybe you can run it using app.open() ?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 20, 2008 Sep 20, 2008
Yeah not sure, doing my script with JS. In photoshop this is much easier, and the script listener really helps. Does AI have any sort of listener to help code? I feel the docs and arranment for all this is really weak..
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 22, 2008 Sep 22, 2008
ScriptListener Plug-In for Illustrator would be a great idea. I looked but could find no such thing. If only the people at Adobe could get together once in a while and get some cohesion between scripting these apps Its more common for me to have to do javascript to obtain something thats not available to AppleScript. Why would this command not exist?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 04, 2008 Dec 04, 2008
What about the doScript method in the Application object??
I was going to try this in a second because I also am trying to execute an Action within my script.
However, the method's "what it does" notes that you should only use this command when running the script external to Illustrator or unexpected results may ensue. Don't ask me what that means.
I'm going to try it anyway and if anybody knows why I shouldn't, or if they have other suggestions please let me know.
thanks
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 04, 2008 Dec 04, 2008
LATEST
This works

--get a sourceFolder that holds the files to print
set sourceFolder to (choose folder with prompt "Choose a folder with files to process:") as text

-- get a list of files of the files to be printed in the sourceFolder
tell application "Finder" to set workingFiles to (every file of folder sourceFolder) as alias list

repeat with aFile in workingFiles
tell application "Adobe Illustrator"
open aFile

set currentFile to front document

tell application "Adobe Illustrator"
do script "Delete Unused Palette Items" from "Default Actions" without dialogs

end tell
close currentFile with saving

end tell
end repeat
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines