Hi I have this applescript working on BigSur Mac. Basically it makes me choose an image file from the file open dialog box and then copies the image's dimensions/file name into the Mac's clipboard (html format).
I want this functionality on an image file that is dropped on the applescript app's icon. Can anyone please help me write the droppeditem applescript that works in BigSur? Thanks!
Working code:
====
set this_file to (choose file) as «class furl»
try
tell application "Image Events"
launch
set this_image to open this_file
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
====
I want this functionality on an image file that is dropped on the applescript app's icon. Can anyone please help me write the droppeditem applescript that works in BigSur? Thanks!
Working code:
====
set this_file to (choose file) as «class furl»
try
tell application "Image Events"
launch
set this_image to open this_file
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
====