|
|
quickie help on Applescript?
|
|
|
|
Dedicated MacNNer
Join Date: Feb 1999
Status:
Offline
|
|
Hi all,
Looking for a way to make Applescript look at a list of folders in a directory, and for each folder make a smart album in photo with the name of the folder. i.e.
foreach (folder name){
create smartalbum searching for all files containing name of the folder
}
is this dooable?
Thanks,
Tyler
|
|
|
|
|
|
|
|
|
Professional Poster
Join Date: Feb 2000
Location: Nashua NH, USA
Status:
Offline
|
|
repeat for every theFolder in ( every folder of theDirectory )
set theItems to every file of theFolder
set theAlbumFiles to {}
repeat with theItem in theItems
if name of theItem contains name of theFolder
copy theItem to end of theAlbumFiles
end
end
end
Should get you started. Not at home now So i can't test it.
|
|
|
|
|
|
|
|
|
Dedicated MacNNer
Join Date: Sep 2000
Location: Cupertino, CA USA
Status:
Offline
|
|
Originally Posted by tycheung
Hi all,
Looking for a way to make Applescript look at a list of folders in a directory, and for each folder make a smart album in photo with the name of the folder. i.e.
foreach (folder name){
create smartalbum searching for all files containing name of the folder
}
is this dooable?
Thanks,
Tyler
I don't believe you can use AppleScript to generate Smart Albums in iPhoto. The term "Smart" does not appear anywhere in its scripting dictionary.
But, here's how you would make new albums from a list of folder names:
Code:
set this_folder to choose folder without invisibles
tell application "Finder"
set the folder_names to the name of every folder in this_folder
end tell
tell application "iPhoto"
repeat with i from 1 to the count of the folder_names
set this_name to item i of the folder_names
if not (exists album this_name) then
new album name this_name
end if
end repeat
end tell
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Forum Rules
|
|
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
|
|
|
|
|
|