Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Create custom-ordered photos for iPhoto CD/DVD burns Apps
There is no perfect way to burn CD/DVD of photos exported from iPhoto that respect the manual order you define in an album. Whether you burn the CD/DVD directly from iPhoto, or export it first, the burnt CD/DVD does not respect the manual order.

One workaround consists of exporting with Album name as title of the photos. For each photo, a number is added that corresponds to the order of the photo in your album. With this trick, you can preserve the manual order but this has two drawbacks:
  1. It does not work if you have more than 99 photos in an album (the number appended respects the format nn, i.e., 01, 02 ... 99, 100 so that the order gets screwed up beyond 99 photos).
  2. It does not allow you to use the wonderful titles that you've spent hours defining for your pictures.
This AppleScript allows you to add the number corresponding to a photo's order before its title, and using the format nnnn - , so that it works for up to 9,999 photos per album (and it's very easy to change in the script). It first checks if this numbering already exists before each title, and if it does, it does not add it.

All you need to do after running the script is to export your album with Titles as name for the files, and burn the resulting folder.

Since you may want that numbering to be temporary (or since you may have mistakenly run it in the wrong album), I also wrote this AppleScript that allows you to remove the numbering. Run either of the scripts with the album you want to apply it to selected in iPhoto.

Since there is no way to update iPhoto's library when changing a file's name, it's unfortunately not possible (and would have dire consequences) to directly change the file names using such a script (with a couple more lines telling the Finder what to do). Because of that, you really need to export your album before burning, and can't use this trick to directly burn to CD/DVDs from iPhoto.

I'm sure the way I wrote the scripts is not the most elegant solution, so feel free to go ahead and correct/adapt it.
    •    
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[6,345 views]  

Create custom-ordered photos for iPhoto CD/DVD burns | 4 comments | Create New Account
Click here to return to the 'Create custom-ordered photos for iPhoto CD/DVD burns' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
better leading zeros code
Authored by: airdrummer on Jan 09, '07 04:17:13AM
eliminate the tedious if then(/else;-)s:

          set prefixName to (text -4 thru -1 of ("0000" & i)) & " - "


[ Reply to This | # ]
better leading zeros code
Authored by: peterrosen on Jan 11, '07 04:24:01AM

Please don't assume we all know where to put the code you suggest! Could you specifiy what it replaces? Also the author mentions potential adjustments. What is he meaning?



[ Reply to This | # ]
sorry, i assumed u would RTFC;-)
Authored by: airdrummer on Jan 11, '07 05:40:22AM
replace this:
		set prefixName to ""
		if i < 1000 then
			set prefixName to "0" & prefixName
		end if
		if i < 100 then
			set prefixName to "0" & prefixName
		end if
		if i < 10 then
			set prefixName to "0" & prefixName
		end if
		set prefixName to prefixName & i & " - "
with my 1 liner...

i would also replace

		set alreadyNumbered to true
		repeat with j from 1 to 4
			if character j of oldPhotoName is not in {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9"} then
				set alreadyNumbered to false
			end if
		end repeat
		if (" - " is not (characters 5 thru 7 of oldPhotoName as string)) and not alreadyNumbered then
			set the name of item i of thePhotos to prefixName & oldPhotoName
			set renamedNumber to renamedNumber + 1
		end if
with
               try      -- resort to cli cuz a/s sux 4 pattern matching;-}
                    do shell script " echo "& quoted form of (oldPhotoName as string) & " | egrep '^[0-9]* - '"
			set the name of item i of thePhotos to prefixName & oldPhotoName
			set renamedNumber to renamedNumber + 1
		on error
                        -- dss throws exception when not found
                end try


[ Reply to This | # ]
Create custom-ordered photos for iPhoto CD/DVD burns
Authored by: hptroll on Jan 11, '07 02:31:59PM

I meant that :
- there were more elegant ways to write the scripts (thanks, airdrummer, for doing that: this was one of my first scripts, and I had to find the proper syntax; the solution you suggest is precisely what I was looking for)
- that you might need to adapt if, for example, you want to add the numbering after the title instead of before it, or if you want to handle albums with over 10000 photos.

Note that it still works perfectly as is.



[ Reply to This | # ]