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


delay x | 30 comments | Create New Account
Click here to return to the 'delay x' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
delay x
Authored by: VRic on Sep 30, '04 05:30:14PM
what do i put in there to give it a 5-10 second wait or something before it ejects the ipod?
delay x where x is the number of seconds

For example:
tell application "iTunes" to update "iPod"
delay 10
tell application "Finder" to eject "iPod"


Of course this isn't really waiting for the update to complete. Unless there's a sanctionned way to do it, one needs a workaround; maybe something like this would do:
- create a dummy playlist in iTunes (it should be the last to be sent, I don't know in what order playlists are updated)
- delete the similarly named playlist from the iPod if there's one (leftover from a previous run of the script)
- update the ipod
- wait until the playlist is on the ipod by running a "repeat until" loop testing for that list or one of it's tracks and containing nothing or a "delay 1" statement for example (I have no iPod so I don't know if you can test for a playlist on the ipod without finding the one in iTunes instead but let's say it's possible)
- delete the playlist in iTunes
- then unmount the ipod

This would make sure the update is complete without waiting unnecessarily longer (assuming one can actually be certain the dummy playlist is updated last, which may or may not be predictable).

[ Reply to This | # ]