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 image
set theImageFile to choose file of type "public.image" with prompt ""
-- Launch Image Events and open the image
tell application "Image Events"
launch
open theImageFile
end 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 image
set theImageFile to choose file of type "public.image" with prompt ""
-- Locate an output folder
set 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 Events
tell application "Image Events"
launch
-- Open the image
set theImage to open theImageFile
tell theImage
-- Determine a save name for the image
set theName to name
set theSaveName to "temp-" & theName
-- Scale the image by 50%
if scaleByPercentage = true then
scale by factor 0.5
-- Scale the image to 100px on its longese side
else
scale to size 100
end if
-- Save the image to the output folder, using the save name
save as file type in (theOutputFolder & theSaveName)
-- Close the image
close
end tell
end 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