Re: Script to Open Camera RAW File Doesn't Open File, Gives No Error
Re: Script to Open Camera RAW File Doesn't Open File, Gives No Error
- Subject: Re: Script to Open Camera RAW File Doesn't Open File, Gives No Error
- From: Rick Gordon <email@hidden>
- Date: Mon, 23 May 2016 00:56:23 -0700
I realized that I had nested application tell blocks, and fixed that in
the following script, but the result is the same: no error; no open file.
Rick Gordon
-----------------
set vExtensionList to {".raf", ".orf", ".cr2", ".nef"}
set vEmptyList to {}
tell application "Adobe InDesign CS6"
tell item 1 of selection of document 1
if class of it is image then
set vImage to it
else
try
set vImage to item 1 of all graphics of it
on error vErrorMessage
display alert "Not an image"
return
end try
end if
tell item link of vImage
if link type is not "JPEG" then
display alert "Not a JPEG"
return
end if
set vImageAlias to file path as alias
set vImageFullName to name
end tell
end tell
end tell
tell application "Finder"
tell container of file vImageAlias
set my text item delimiters to {".jpg", "jpeg"}
set vImageBaseName to text item 1 of vImageFullName
repeat with vItem in vExtensionList
try
set end of vEmptyList to (some file whose name is
vImageBaseName & vItem)
end try
if length of vEmptyList > 0 then
set vCameraRawFile to (item 1 of vEmptyList) as alias
set vCameraRawFilePOSIXPath to POSIX path of vCameraRawFile
exit repeat
end if
end repeat
end tell
end tell
tell application "Adobe Photoshop CC 2015"
open vCameraRawFilePOSIXPath as Camera RAW
activate
end tell
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden