AppleScript 2.7, ScriptEditor 2.11, OS Catalina 10.15 (latest Udqate)
After updating to Catalina I can't run some AppleScripts. Firstly I thought about a bug in my code, therefore I tried some AppleScripts published on the Apple developer site and got the same error bevahiour. Can anybody explain why this happens and how to solve this?
Here the source of the scripts I tried without success:
Listing 38-1AppleScript: Opening an image with Image Events
-- Prompt for an imageset theImageFile to choose file of type "public.image" with prompt ""-- Launch Image Events and open the imagetell application "Image Events"launchopen theImageFileend tell--> Result: image "My Image.png" of application "Image Events"
error Output:
tell application "Script Editor"
choose file of type "public.image" with prompt ""
--> alias "Intenso 4TB:Test:Work:Result:GOPR5491.jpg"
end tell
tell application "Image Events"
launch
open alias "Intenso 4TB:Test:Work:Result:GOPR5491.jpg"
--> missing value
end tell
Ergebnis:
missing value
Listing 38-5AppleScript: Scaling an image
-- Prompt for an imageset theImageFile to choose file of type "public.image" with prompt ""-- Locate an output folderset theOutputFolder to (path to desktop folder as string)-- To scale by percentage, set this value to true. To scale to a specific size, set it to false.set scaleByPercentage to true-- Launch Image Eventstell application "Image Events"launch-- Open the imageset theImage to open theImageFiletell theImage-- Determine a save name for the imageset theName to nameset theSaveName to "temp-" & theName-- Scale the image by 50%if scaleByPercentage = true thenscale by factor 0.5-- Scale the image to 100px on its longese sideelsescale to size 100end if-- Save the image to the output folder, using the save namesave as file type in (theOutputFolder & theSaveName)-- Close the imagecloseend tellend tell
Result on Catalina 10.15:
error "„name of missing value“ can not read." number -1728 from name of missing value
Here's the script output:
tell application "Script Editor"
choose file of type "public.image" with prompt ""
--> alias "Intenso 4TB:Test:Work:Result:GOPR5491.jpg"
end tell
tell current application
path to desktop as string
--> "Macintosh HD:Users:raimund:Desktop:"
end tell
tell application "Image Events"
launch
open alias "Intenso 4TB:Test:Work:Result:GOPR5491.jpg"
--> missing value
Ergebnis:
error "„name of missing value“ kann nicht gelesen werden." number -1728 from name of missing value