Tuesday, May 11, 2021

#1 2021-04-15 11:34:16 am

From:: BFE, Massachusetts
Registered: 2013-01-13
Posts: 493

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,


Hackintosh built February, 2012 |  Mac OS Sierra
GIGABYTE GA-Z68X-UD3H-B3 | Core i5 2500k | 16 GB DDR3 | GIGABYTE Geforce 1050 TI 4GB
250 GB Samsung 850 EVO | 4 TB RAID
Dell Ultrasharp U3011 | Dell Ultrasharp 2007FPb



#2 2021-04-15 12:27:56 pm

Registered: 2015-08-04
Posts: 109

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

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.

Scripting in Mac OS X 10.7.5, OS X 10.9.5, macOS 10.14.6



#3 2021-04-15 05:19:54 pm

Marc Anthony
From:: Dallas, TX
Registered: 2006-04-27
Posts: 1017

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

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



#4 2021-04-15 06:08:58 pm

Shane Stanley
From:: Australia
Registered: 2002-12-07
Posts: 6628

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

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-i … onary/3066

Shane Stanley <sstanley@myriad-com.com.au>



Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)