Script somehow has raw chevron-syntax apple events, won't compile

I feel like I’ve seen this question here, but was unable to find the answer via search. Apologies for asking again.

I’ve got an old script that commands Adobe Illustrator CS6, which I no longer have.

I have current Illustrator, and other old scripts written for CS6 work fine with no changes.

But this one script, even when I first open it and it’s not compiled, it doesn’t show the normal text of the AI commands, it shows the raw “chevron syntax” apple events, such as:

set ArtBounds to the «class aiBG»
set CropMarkTop to make new «class caPL» in RegLayer with properties {«class aiFS»:topRegMarkFile, «class paPs»:{0.0, 0.0}}
		set Mark1Width to the «class pSHw» of CropMarkTop
		set Mark1Height to the «class pSHh» of CropMarkTop

I’ve updated the “tell” statements to current AI, but it still won’t compile and highlights these chevron-syntax statements when I attempt to.

I took a look at “Recover Damaged Script” in Script Debugger, but it doesn’t even recognize the file as something it can try to open that way. The code was saved as a .applescript text file.

Any help getting my script back would be appreciated,

Thanks.

In any case, the only solution is to re-write the script because the object model and command syntax have likely changed since CS6. The current version of AppleScript language doesn’t recognize some parts of the command structure and implied object model. Have you written those scripts yourself? If yes then you should know how to work out the new syntax emulating the old behaviour.

It’s actually more likely that the connection to the dictionary just got broken and led to raw events being displayed; Adobe rarely significantly changes commands between versions, excepting for new features. This is what that code would’ve been originally:

tell application "Adobe Illustrator"
	set ArtBounds to the geometric bounds
	set CropMarkTop to make new placed item in RegLayer with properties {file path:topRegMarkFile, position:{0.0, 0.0}}
	set Mark1Width to the width of CropMarkTop
	set Mark1Height to the height of CropMarkTop
end tell

Further to Marc’s reply, sometimes the solution is to:

  • Quit both AI and Script Debugger.

  • Launch AI.

  • Launch Script Debugger, go to Preferences → Dictionary, and click Clear Cache.

  • Open the script and compile.

There’s a bit of an issue with current versions of Illustrator because they seem to have left out the Info.plist entries that signify that it’s scriptable. Not directly related, but it doesn’t help things. See:

https://forum.latenightsw.com/t/adobe-illustrator-dictionary/3066