Skip to main content
Participant
Aug 29, 2024 10:36 PM UTC
Answered

How can I install estoolkit?

I'd like to run a script like this:

 

  • estoolkit -run path/to/myscript.jsx

 

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?

This topic is closed to new replies. Start a new post to keep the conversation going.
CarlosCanto
CarlosCantoCorrect answer
Community Expert
Sep 1, 2024 1:07 AM UTC

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

9 replies

CarlosCanto
Community Expert
CarlosCantoCommunity ExpertCorrect answer
Community Expert
Sep 1, 2024 1:07 AM UTC

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

Translate
Inspiring
Aug 30, 2024 7:39 AM UTC

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.)

Translate
m1b
Community Expert
Community Expert
Aug 31, 2024 12:32 AM UTC

Very clever! Thanks!

Translate
CarlosCanto
Community Expert
Community Expert
Sep 1, 2024 1:00 AM UTC

or...place the script in the secure "My Documents" folder to bypass the warning

Translate
jduncan
Community Expert
Community Expert
Aug 29, 2024 11:18 PM UTC

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
Translate
m1b
Community Expert
Community Expert
Aug 29, 2024 11:32 PM UTC

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

Translate
jduncan
Community Expert
Community Expert
Aug 30, 2024 4:59 PM UTC

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!

Translate
m1b
Community Expert
Community Expert
Aug 29, 2024 10:44 PM UTC

I don't know the answer, but I think people will want to know what platform—MacOS or Windows?

Translate