• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Script to Open Camera RAW File Doesn't Open File, Gives No Error
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Script to Open Camera RAW File Doesn't Open File, Gives No Error
      • From: Christopher Stone <email@hidden>
    • Re: Script to Open Camera RAW File Doesn't Open File, Gives No Error
      • From: Shane Stanley <email@hidden>
References: 
 >Script to Open Camera RAW File Doesn't Open File, Gives No Error (From: Rick Gordon <email@hidden>)

  • Prev by Date: Script to Open Camera RAW File Doesn't Open File, Gives No Error
  • Next by Date: Re: Script to Open Camera RAW File Doesn't Open File, Gives No Error
  • Previous by thread: Script to Open Camera RAW File Doesn't Open File, Gives No Error
  • Next by thread: Re: Script to Open Camera RAW File Doesn't Open File, Gives No Error
  • Index(es):
    • Date
    • Thread