4 Replies
      Latest reply on Nov 6, 2019 5:01 AM by ostoura
      Raimund0815 Level 1 Level 1 (0 points)

        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:

         

        https://developer.apple.com/library/archive/documentation/LanguagesUtilities/Conceptual/MacAutomationScriptingGuide/ManipulateImages.html

         

        Listing 38-1AppleScript: Opening an image with Image Events

        1. -- Prompt for an image
        2. set theImageFile to choose file of type "public.image" with prompt ""
        3. -- Launch Image Events and open the image
        4. tell application "Image Events"
        5.   launch
        6.   open theImageFile
        7. end tell
        8. --> 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

         

        1. -- Prompt for an image
        2. set theImageFile to choose file of type "public.image" with prompt ""
        3. -- Locate an output folder
        4. set theOutputFolder to (path to desktop folder as string)
        5. -- To scale by percentage, set this value to true. To scale to a specific size, set it to false.
        6. set scaleByPercentage to true
        7. -- Launch Image Events
        8. tell application "Image Events"
        9.   launch
        10.   -- Open the image
        11.   set theImage to open theImageFile
        12.   tell theImage
        13.   -- Determine a save name for the image
        14.   set theName to name
        15.   set theSaveName to "temp-" & theName
        16.   -- Scale the image by 50%
        17.   if scaleByPercentage = true then
        18.   scale by factor 0.5
        19.   -- Scale the image to 100px on its longese side
        20.   else
        21.   scale to size 100
        22.   end if
        23.   -- Save the image to the output folder, using the save name
        24.   save as file type in (theOutputFolder & theSaveName)
        25.   -- Close the image
        26.   close
        27.   end tell
        28. 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

        • Re: AppleScript problem with Catalina?
          g3scb Level 1 Level 1 (0 points)

          Same problem exprienced with Catalina update 10.15.1 (19B88): Image Events results in 'missing value'.

            • Re: AppleScript problem with Catalina?
              Raimund0815 Level 1 Level 1 (0 points)

              It's still the same problem in any case you try to open an image in the image events object. Unfortunately I can not find any details about the cause of this fails, more important would be, if it is a known bug with Catlaina 10.15.x and if there is any info available to avoid these kind of problems. It is very uncool for all script autors who intend to use image envent objects for their tasks.

               

              So I will stop immediately any scripting activity until I know, why these problems happens and if they will be fixed asap.

               

              It is very uncool for developpers if they are surprised like like this! Developpers will expect running tools after updates of OSx released! The ios 13.2 extensions for xcode were alos released days after release of 10.15.1! No warning before updating was shown!
              Properly working tool chains are more important than emojis or super sound and graphics for play kids. Developpers are forced to use a perfect dev. Environment!

               

              I Hopefully look forward to any official feedback by apple. Current experience ist, that none of the initiated tickets regarding mentioned problems are responded satisfactoril.
              if these kind of problems will be future standard, it is more efficient to switch to MS tool chain and environment.

            • Re: AppleScript problem with Catalina?
              ostoura Level 1 Level 1 (0 points)

              Same here, all image events commands are not working anymore since catalina, i'll file a bug and i appreciate if everyone also do so