Copy link to clipboard
Copied
I'd like to run a script like this:
For example, to get Adobe Illustrator to do something from the command line.
How can I get estoolkit? If that's not possible, then how can I run the script from the command line?
ESTK is no longer supported. It still works on Windows only because it still supports 32 bit programs. Macs won't install or run ESTK.
If you're on Windows you can find and istall the ESTK through the the Creative Cloud App
Copy link to clipboard
Copied
I don't know the answer, but I think people will want to know what platform—MacOS or Windows?
Copy link to clipboard
Copied
This works on Mac... The `-a` flag tells the open command which program to open the file with.
open -a Adobe\ Illustrator ~/path/to/script.js
Copy link to clipboard
Copied
Hi @jduncan, that does indeed work, thanks! When I do it Illustrator gives me a warning:
Is that security check something that we can turn off?
- Mark
Copy link to clipboard
Copied
Hey, you just need to set the app preferences 'ShowExternalJSXWarning' to false. This can be done by running the simple script below. FYI, this is the same pref that lets you easily run scripts by drag-and-drop into Ai.
app.preferences.setBooleanPreference('ShowExternalJSXWarning', false)
And, unfortunately, the link provided by Adobe in the dialog doesn't link to anything that helps. The relevant link is here. Cheers!
Copy link to clipboard
Copied
Thanks!
Copy link to clipboard
Copied
On Mac, use AppleScript. Paste the following into a new Script Editor document (/Applications/Utilities/Script Editor.app) and save as `aitool.applescript`:
#!/usr/bin/env osascript
property _name : "aitool"
on run argv
if argv is {} then set argv to {"-h"}
set opt to item 1 of argv
set argv to rest of argv
if {opt} is in {"-h", "--help"} then
log "Usage:"
log _name & " -h"
log _name & " -o /path/to/file.ai [ file ... ]"
log _name & " -r /path/to/file.jsx [ argument ... ]"
else if {opt} is in {"-o", "--open"} then
repeat with pth in argv
set f to POSIX file pth
try
tell application "Adobe Illustrator" to open f without dialogs
on error msg number num
log msg & " (" & num & ")"
end try
end repeat
else if {opt} is in {"-r", "--run"} then
set pth to item 1 of argv
set argv to rest of argv
set f to POSIX file pth
try
tell application "Adobe Illustrator"
do javascript f with arguments argv
end tell
on error msg number num
log msg & " (" & num & ")"
end try
else
log "Unknown option: " & opt
end if
end run
In Terminal.app, make it executable and move it to a directory that on your shell $PATH:
chmod +x aitool.applescript
sudo mv aitool.applescript /usr/local/bin/aitool
You can now run from Terminal, e.g.
aitool -r /Users/foo/myscript.jsx
Support for relative file paths, more robust error handling (e.g. file not found), etc is left as an exercise. (This may help.)
Copy link to clipboard
Copied
Very clever! Thanks!
Copy link to clipboard
Copied
or...place the script in the secure "My Documents" folder to bypass the warning
Copy link to clipboard
Copied
ESTK is no longer supported. It still works on Windows only because it still supports 32 bit programs. Macs won't install or run ESTK.
If you're on Windows you can find and istall the ESTK through the the Creative Cloud App