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

Click here to return to the 'Folder Actions' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Folder Actions
Authored by: mhorn on Aug 04, '12 12:35:57PM
You can skip the cron job part and have the script applied automatically with a folder action. For example, modify the script to look like this:

property my_title : "Trim all tracks in a playlist"
on adding folder items to this_folder after receiving added_items
	delay 2 --Here to allow iTunes time to settle
	tell application "iTunes"
		set thePlaylist to playlist "ABC News"
		with timeout of 300 seconds
			repeat with i from 1 to (index of last track of thePlaylist)
				my reset_this(track i of thePlaylist)
			end repeat
		end timeout
	end tell
end adding folder items to

to reset_this(t)
	tell application "iTunes"
			set start of t to 50.0
		on error m
			log m
		end try
	end tell
end reset_this
Then put this script in /Library/Scripts/Folder Action Scripts. Now attach it to the podcast folder in your iTunes library. Viola, your scripts are updated automatically every time a new one is downloaded.

[ Reply to This | # ]