I store photo files in folders on my computer before i add them into iphoto.
I want to add the contents of a selected to folder to iphoto and name the new album as the folder name
I have created an automator flow where I do the following
(Select folder initially to work)
The issue i have is the variable name sets the full path of the files, /Users/Johnny/Photos/Dayout
Is the a script that can take just the name of the initial folder "Dayout"
Thanks in advance to anyone who can help
Cheers
John
activate application "SystemUIServer" -- http://www.openradar.me/9406282
tell application "Finder"
activate
repeat with f in (get selection as alias list)
set n to name of f
tell application "iPhoto"
if not (exists album n) then new album name n
import from f to album n
end tell
end repeat
end tell
There is a bug in 10.7 and 10.8 where Finder ignores new windows when getting the selection property. If you open a new Finder window, select some items, and run tell app "Finder" to selection
in AppleScript Editor, the result is items selected in some window behind the frontmost window (or an empty list). One workaround is to move focus to another application and back.