Skip to main content
Inspiring
January 8, 2021
Answered

(Applescript) do javascript command no longer works in 25.1

  • January 8, 2021
  • 4 replies
  • 6821 views

Hi we got plenty of script in our workflow, and since the 25.1 update the scripts no longer work. (Was working in 25.0.1)

 

They all have 1 thing in common, 

 

tell application "Adobe Illustrator"

do javascript "JAVASCRIPT CODE HERE"

end tell

 

Nothing works and i'm resulted with:

missing value

 

Whatever is inside the quotes, nothing works, we always get the missing value as as result

 

I tried to copy my Javascript code in a .jsx file and open it from the applescript and it worked but we cant link a .jsx file there as variable data is injected in the script.

 

Is there something different in the way 25.1 handles javascript inside an applescript versus all the Illustrator previous versions?

 

 

Thank you for your help!

This topic has been closed for replies.
Correct answer Maxcoco

It has been fixed in 25.2 Beta

4 replies

MaxcocoAuthorCorrect answer
Inspiring
January 22, 2021

It has been fixed in 25.2 Beta

Karl Fabian5F97
Inspiring
February 11, 2021

Hello!

 

Are you certain that is the case? I am running Illustrator version 25.2.0 and it just won't execute the Javascript I send it via AppleScript. Here is my code:

set myJavascript to "
#target illustrator
function test(){
    #include '/Users/opus/Desktop/ApplySaturation.jsx'
};
test();
"
on adding folder items to theAttachedFolder after receiving theNewItems

	-- Get the name of the attached folder
	tell application "Finder"

		set theName to name of theAttachedFolder
		-- Count the new items
		set theCount to length of theNewItems

		-- Display an alert indicating that the new items were received
		activate

		display alert "Attention!" message (theCount & " new items were detected in folder " & (quoted form of theName) & "." as string)
		tell application "Adobe Illustrator"
			do javascript myJavascript
		end tell
		display alert "check"
	end tell
end adding folder items to

It's a fairly easy example, and if I run just that bit of javascript directly from illustrator it works perfectly. When this AppleScript is executed the "check" alert never executes. Not sure if I am missing something here but I've gone over privileges and everything I can think of so it feels like it must be some sort of bug.

 

If you have any ideas as for why this isn't working for me that would be great.

 

Thanks 🙂

MaxcocoAuthor
Inspiring
February 11, 2021

I'm no Applescripct expert so I can't really help you on this,

 

Is your script working on 25.0?  I would start there

Legend
January 12, 2021

I have the same symptoms with Mojave and Illustrator 25.1.

 

I've created a topic on uservoice, please vote for it.
(Applescript) do javascript command no longer works in Illustrator 2021(25.1) 

Inspiring
January 11, 2021

I to am having issues using my Applescripts. I have been using my particular ApleScript for over 6 years with no issues. The issue began with the 25.1 update this morning whith script to starting to fail. It worked correctly with 25. Also I am still using Mojave, so it it is not related to a new Operating System. If I try to use the script with in an Illustrator Action I will get a message "Adobe Illustrator got an error: missing value doesn't understand the "concentrate rotation matrix" message. If I run the script out of the Applescript dropdown, the message doesnt come out but it has the same result. It does all of it's funtion except there is a rotate at the end and it doesnt do that part. I have three friends that use this script and they too are now now getting this Issue. 

MaxcocoAuthor
Inspiring
January 11, 2021

Yeah i'm also on Mojave nothing else changed except update to 25.1,

I've reverted back to 25.0.1 and it's working, there is definitely something wrong in this version

Inspiring
January 8, 2021

I might be wrong, just a guess, but could it be Apple's security sandboxes? Make sure the System Preferences are set up to allow the AppleScript to control Illustrator etc... - I've not studied this in detail, but more recent versions of Mac OS X are very picky in what they allow. I'd have a look in 'System Preferences - Security' and make sure allowance is made for the script to control Illustrator. I think it might be under 'Automation'.

MaxcocoAuthor
Inspiring
January 11, 2021

Thank you for your Answer, 

It might have been a good idea, i've wiped the automation preferences to start from scratch.

I Executed the scripts, it asks me to give permission, I do and the script just don't execute.

 

Same manipulation on 25.0 and it works, there really seems to be a problem with 25.1 executing a Javascript from an applescript

Participant
January 11, 2021

I'm unable to use the commands 'export' and 'embed' since the update for what it's worth