Under Monterey 12.1, AppleScript 2.8, my scripts calling SatimageOSAX.app v 1.0.2 will not compile in Script Editor, let alone run. Even trying to compile a very basic script like
use application "SatimageOSAX"
results in a Syntax Error: Internal table overflow, with application “SatimageOSAX” highlighted in the Script Editor window.
I’ve restarted the Mac, deleted the app and re-installed it, and given it full disk access in System Prefs/Security and Privacy/Privacy. But still no joy. The app is installed in the standard Applications folder.
(I can still use Smile2, which packages the most recent versions of the various Satimage osaxen - December 6 2021 at the time of writing - in Smile2/Contents/Resources/Scripting Additions. But that means re-writing the scripts to remove the application tell blocks.)
You’re out of luck. SatimageOSAX.app was a temporary fix, released with the warning: “You should find alternative means of accomplishing what the Satimage scripting additions did for you in the past.”
Hi,
does anybody know a way to access the resource fork of a file as Satimage osax did?
I do know the “…namedfork/rsrc” method, but maybe there is some preestablished way / a library / a method using ASObjC or the like to access resources (even if only partially, esp. TEXT, UTF or RTF strings in very old text clippings) I’d not have to reinvent the wheel. Thanks for any pointers!
For example, I have some .webloc files on my Mac. I can get its URL this way:
use AppleScript version "2.4"
use framework "Foundation"
use scripting additions
set filePath to POSIX path of (choose file of type "webloc")
set |⌘| to a reference to current application
set fileURL to |⌘|'s NSURL's fileURLWithPath:filePath
set theData to |⌘|'s NSData's dataWithContentsOfURL:fileURL
set theDict to |⌘|'s NSPropertyListSerialization's propertyListWithData:theData options:0 format:(missing value) |error|:(missing value)
set itsURL to (theDict's valueForKeyPath:"URL") as text
Other example. Following script returns list of URLs contained by one of .webarchive files on my Mac:
use AppleScript version "2.4"
use framework "Foundation"
use scripting additions
set filePath to POSIX path of (choose file of type "webarchive")
set |⌘| to a reference to current application
set fileURL to |⌘|'s NSURL's fileURLWithPath:filePath
set theData to |⌘|'s NSData's dataWithContentsOfURL:fileURL
set theDict to |⌘|'s NSPropertyListSerialization's propertyListWithData:theData options:0 format:(missing value) |error|:(missing value)
set itsURL to (theDict's valueForKeyPath:"WebSubresources.WebResourceURL") as list