Tuesday, November 19, 2019

#1 2019-11-07 01:23:42 am

ppayne
Member
From:: Isesaki, Japan
Registered: 2007-10-31
Posts: 63
Website

Catalina has broken Image Evens

Can anyone else concur? This script, and pretty much all the things I used to do with Image Events to automate image work, has died.

set this_file to choose file
try
    tell application "Image Events"
        -- start the Image Events application
        launch
        -- open the image file
        set this_image to open this_file
        -- extract the property value
        copy the resolution of this_image to {H_res, V_res}
        -- purge the open image data
        close this_image
    end tell
    display dialog "Resolution: " & (H_res as string)
on error error_message
    display dialog error_message
end try

Offline

 

#2 2019-11-07 02:35:28 am

ldicroce
Member
Registered: 2017-11-25
Posts: 137

Re: Catalina has broken Image Evens

I also get an error with Catalina 10.15.0
L.

Offline

 

#3 2019-11-07 07:47:06 am

peavine
Member
From:: Prescott, Arizona
Registered: 2018-09-04
Posts: 219

Re: Catalina has broken Image Evens

ppayne wrote:

Can anyone else concur? This script, and pretty much all the things I used to do with Image Events to automate image work, has died.


I'm on Mojave now and confirmed that ppayne's script works as expected. I previously upgraded to Catalina and found that many of my script's--including several utilizing Image Events and sips--would not work. I didn't spend much time troubleshooting this, as I quickly realized that Catalina was not a worthwhile upgrade for me. I'm sure in time I will give Catalina another try, though, and look forward to any fixes suggested by forum members.

Last edited by peavine (2019-11-07 07:53:58 am)


2018 Mac mini - macOS Mojave

Offline

 

#4 2019-11-08 07:17:29 pm

Shane Stanley
Member
From:: Australia
Registered: 2002-12-07
Posts: 6034

Re: Catalina has broken Image Evens

There seem to be two issues with Image Events and Catalina.

First, it doesn't seem to be able to deal with aliases. In the sample code above, the open command returns missing value, so the rest of the script goes nowhere. However, if you pass a file reference -- «class furl» -- the open command works.

The second issue is that, depending where the image is, you may need permission to read the file, and in such cases no prompt appears. Presumably that's because Image Events is a background-only app. You can get around this by going to System Preferences -> Security & Privacy -> Privacy and adding Image Events to Full Disk Access.

So this now works here:

Applescript:

set this_file to (choose file) as «class furl»
tell application "Image Events"
   launch
   set this_image to open this_file
   copy the resolution of this_image to {H_res, V_res}
   close this_image
end tell
display dialog "Resolution: " & (H_res as string)

Last edited by Shane Stanley (2019-11-08 07:18:15 pm)


Shane Stanley <sstanley@myriad-com.com.au>
www.macosxautomation.com/applescript/apps/
latenightsw.com

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)