Hi so I have this Applescript code that basically works this way: You drop an image file on the Applescript icon and it fills Mac's clipboard with the image's dimension and file name (html format). Now the problem here is that this code works on Mojave macos but not on Big Sur which I use.
Here is the code, can anyone please post a fix by testing it on a Big Sur Macos computer? I've worked quite hard on this one:
====
on open theDroppedItems
set theCurrentItem to item 1 of theDroppedItems
try
tell application "Image Events"
launch
set this_image to open theCurrentItem as «class furl»
copy the dimensions of this_image to {H_res, V_res}
copy the name of this_image to originalname
close this_image
end tell
set myvar to originalname
set the clipboard to "src=\"" & myvar & "\"" & " width=\"" & H_res & "\"" & " width=\"" & V_res & "\""
end try
end open
====
Here is the code, can anyone please post a fix by testing it on a Big Sur Macos computer? I've worked quite hard on this one:
====
on open theDroppedItems
set theCurrentItem to item 1 of theDroppedItems
try
tell application "Image Events"
launch
set this_image to open theCurrentItem as «class furl»
copy the dimensions of this_image to {H_res, V_res}
copy the name of this_image to originalname
close this_image
end tell
set myvar to originalname
set the clipboard to "src=\"" & myvar & "\"" & " width=\"" & H_res & "\"" & " width=\"" & V_res & "\""
end try
end open
====