• 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
Exporting photos via keyword in Applescript
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Exporting photos via keyword in Applescript


  • Subject: Exporting photos via keyword in Applescript
  • From: Chris Glowacki <email@hidden>
  • Date: Wed, 2 Jan 2008 15:49:40 -0800

Hello All,

(pardon the verbosity-thought it might help get the question answered)

No one was able to answer my earlier question  about how to do this,  so I share my crude results here- which seem to work,
and request instead any comment on how to speed up or otherwise improve this brute force script.

In iPhoto I create two smart folders called 'Sorted' and 'Unsorted' whose contents are based on pass (and fail)  criteria of  'Keyword is none' .
To sort my shoots, I open  the 'Unsorted' folder, and as I attach keywords,  files are removed (and subsequently added to the 'Sorted' folder)
When I'm done, I would like to export the files to folders named by keyword (ex: "Sunset", "River", "Junk" etc- and I now only have to look at the files in the 'Sorted' folder)

In iPhoto you can select 'Library', and click on a keyword to get all photo's containing that keyword- you can then Select all, and export.

This is the function I was trying to duplicate in AS-- What I came up with is rather crude- since I can't export en masse, but must do so photo-by-photo-which is still faster than my previous manual method

- it works well, but I'm willing to be those of you who are 'real' scripters can speed it up..  Maybe offer a suggestion on how to handle multiple keywords?

Also- when you import files to iPhoto (6)- they do not immediately show up in a Smart folder unless you re-start iPhoto, or edit the Smart Folder (I just go 'edit smart album' and then re-save without making any changes)- is there a way to force this to happen in AS?


thanks in advance
chris

>> Here is my export-by-keyword script:

tell application "iPhoto"
set kwlist to name of every keyword
tell application "Finder"
set sort_folder to choose folder
repeat with i from 1 to count of kwlist
set this_folder to item i of kwlist
set its_here to exists folder (item i of kwlist) of folder sort_folder
if not its_here then
try
set f1 to make new folder at sort_folder with properties {name:this_folder}
end try
end if
end repeat
end tell
set the_album to "Sorted"
set photo_list to every photo in album the_album
log photo_list
set the_photo_count to count of photo_list
repeat with pcount from 1 to the_photo_count
set this_photo to item pcount of photo_list
set this_keyword to name of keyword 1 of this_photo
set thisphoto to image path of this_photo as POSIX file as alias
tell application "Finder"
duplicate thisphoto to folder this_keyword of folder sort_folder replacing yes
end tell
remove this_photo
end repeat




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: Exporting photos via keyword in Applescript
      • From: "Mark J. Reed" <email@hidden>
  • Prev by Date: Re: Newbie help needed: capturing keypress to record QuickTime timing
  • Next by Date: Re: Newbie help needed: capturing keypress to record QuickTime timing
  • Previous by thread: Apple Mail on Leopard
  • Next by thread: Re: Exporting photos via keyword in Applescript
  • Index(es):
    • Date
    • Thread