0
Script execute Action?
New Here
,
/t5/illustrator-discussions/script-execute-action/td-p/1159219
Sep 19, 2008
Sep 19, 2008
Copy link to clipboard
Copied
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...
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
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Explore related tutorials & articles
New Here
,
/t5/illustrator-discussions/script-execute-action/m-p/1159220#M238246
Sep 19, 2008
Sep 19, 2008
Copy link to clipboard
Copied
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
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
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Community Expert
,
/t5/illustrator-discussions/script-execute-action/m-p/1159221#M238247
Sep 19, 2008
Sep 19, 2008
Copy link to clipboard
Copied
I didn't try this, but maybe you can run it using app.open() ?
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
_Michael_Smither_
AUTHOR
New Here
,
/t5/illustrator-discussions/script-execute-action/m-p/1159222#M238248
Sep 20, 2008
Sep 20, 2008
Copy link to clipboard
Copied
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..
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
New Here
,
/t5/illustrator-discussions/script-execute-action/m-p/1159223#M238249
Sep 22, 2008
Sep 22, 2008
Copy link to clipboard
Copied
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?
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
New Here
,
/t5/illustrator-discussions/script-execute-action/m-p/1159224#M238250
Dec 04, 2008
Dec 04, 2008
Copy link to clipboard
Copied
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
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
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Community Expert
,
LATEST
/t5/illustrator-discussions/script-execute-action/m-p/1159225#M238251
Dec 04, 2008
Dec 04, 2008
Copy link to clipboard
Copied
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
--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
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

