Hi all,
I have a simple script that help me in editing metadata, such as:
use AppleScript version "2.4" -- Yosemite (10.10) or later
use scripting additions
use framework "Foundation"
on run
set therecord to {Title:"LDC tile44", Author:"LDC auth44", Subject:"LDC subj44"}
set posixPath to "/Users/ldicroce/Desktop/10_1016@j_devcel_2021_12_007.pdf"
my setDocumentAttributes:therecord forPDFAt:posixPath
end run
on setDocumentAttributes:attributeRecord forPDFAt:posixPath
set thePath to current application's NSString's stringWithString:posixPath
set thePath to thePath's stringByExpandingTildeInPath()
display dialog "OK1a"
set theUrl to current application's NSURL's fileURLWithPath:thePath
display dialog "OK1b"
set thePDFDoc to current application's PDFDocument's alloc()'s initWithURL:theUrl
display dialog "OK1c"
set theDict to current application's NSDictionary's dictionaryWithDictionary:attributeRecord
thePDFDoc's setDocumentAttributes:theDict
return thePDFDoc's writeToFile:thePath
end setDocumentAttributes:forPDFAt:
And , it works perfectly.
But if I export the script as Applet, then it stops always at this line:
set thePDFDoc to current application's PDFDocument's alloc()'s initWithURL:theUrl
The applet has full access to the disk and folders …
Any help to overcome this?
Thanks.
L.