Apple Script for Illustrator 2020 - JavaScript code was missing

I have been running an Apple Script in Illustrator 2019 with no issues. I have upgraded to Illustrator 2020 and the script no longer works. I get an error: JavaScript code was missing.

Is the location of my Javascript the problem?

Code:

tell application "Finder"
	set theLocation to (target of front window)
	tell theLocation
		if not (exists folder "Art") then make new folder at it with properties {name:"Art"}
		if not (exists folder "PDF") then make new folder at it with properties {name:"PDF"}
		if (exists file "Delete me") then delete file "Delete me"
		try
			move (1st file whose name extension is "indd") to folder "Art" with replacing
		end try
		try
			move (1st file whose name extension is "ai") to folder "Art" with replacing
		end try
		
	end tell
end tell



set inputFolder to choose folder with prompt "Select Illustrator Document." without invisibles
--

tell application "Finder"
	set filesList to (files in inputFolder whose name extension is "ai")
end tell
--
repeat with aFile in filesList
	set fileIndex to 0
	tell application "Finder"
		set theFile to aFile as alias
		set theFileName to name of theFile
	end tell
	
	
	set scripttoRun to "Sim 07:Applications:Adobe:OutlineNoBleedHRLRPDF.jsx" as alias
	tell application "Adobe Illustrator"
		activate
		open theFile
		do javascript scripttoRun
		
		
	end tell
end repeat
--

tell application "Finder"
	set theLocation to (target of front window)
	tell theLocation
		try
			move (files whose name extension is "pdf") to folder "PDF" with replacing
		end try
		try
			move (files whose name extension is "ai") to folder "Art" with replacing
		end try
	end tell
end tell

Put it somewhere else, change the path in the script, and see what happens.

Hi Shane,

The location was not the problem. I have fixed with small amend to script:

Changed:

set scripttoRun to "Sim 07:Applications:Adobe:OutlineNoBleedHRLRPDF.jsx" as alias
	tell application "Adobe Illustrator"
		activate
		open theFile
		do javascript scripttoRun

to:

Tell application "Adobe Illustrator"
		activate
		open theFile
		tell application "Adobe Illustrator" to open file "Sim 07:Applications:Adobe:Outline5mmHRLRPDF.jsx"

Thanks

You might try:

set scripttoRun to "Sim 07:Applications:Adobe:OutlineNoBleedHRLRPDF.jsx" as «class furl»

Seems aliases are causing problems in a couple of places.

is it possible 2020 needs POSIX path for do javascript now too? Open and Save seem to require them now as far as I can tell.

It looks like it doesn’t like aliases. Just use as «class furl» as shown above.

I have no idea what class furl is, but this really saved me hours, thank you!

It’s a “modern” file:

set x to choose file name
class of x --> «class furl»

short for “File Universal Resource Locator”, perhaps?

Under the hood, that’s what it contains.