"Show Raw File" 01 tell application "iPhoto" activate try copy (my selected_images()) to these_images if these_images is false or (the count of these_images) is not 1 then error "一個づつしか調べきらんと" set this_image to item 1 of these_images set textName to (image filename of this_image) as text set textName to my replaceW(textName, ".jpg", ".nef") set textPath to (image path of this_image) as text set textDate to (date of this_image) as text set oldDel to AppleScript's text item delimiters set AppleScript's text item delimiters to " " set textDate to text item 1 of textDate set textDate to my replaceW(textDate, "-", "/") set AppleScript's text item delimiters to "/" set libraryName to text item ((count text item of textPath) - 4) of textPath set AppleScript's text item delimiters to libraryName set textPath to text item 1 of textPath set AppleScript's text item delimiters to oldDel set textPath to textPath & libraryName & "/" & textDate & "/Originals/" & textName
--"Show Raw File"02 try set this_imagefile to ((textPath) as POSIX file) as alias on error try set changePath to text item ((count item of textPath) - 5) of textPath & text item ((count item of textPath) - 4) of textPath & ".nef" set textPath to my replaceW(textPath, changePath, ".nef") set this_imagefile to ((textPath) as POSIX file) as alias on error display dialog "RAWファイルじゃなかろごたぁ" end try end try
on error error_message number error_number if the error_number is not -128 then display dialog error_message buttons {"Cancel"} default button 1 end if end try end tell
--"Show Raw File"03 tell application "Finder" activate set visible of (every process whose visible is true and frontmost is false) to false reveal this_imagefile end tell
on selected_images() tell application "iPhoto" try set these_items to the selection if the class of item 1 of these_items is album then error return these_items on error return false end try end tell end selected_images
on replaceW(src, tg, rp) set oldDel to AppleScript's text item delimiters set AppleScript's text item delimiters to tg set myList to text items of src set AppleScript's text item delimiters to rp set myText to myList as string set AppleScript's text item delimiters to oldDel return myText end replaceW