Confounded by Folder Action Script (10.5.6)
Confounded by Folder Action Script (10.5.6)
- Subject: Confounded by Folder Action Script (10.5.6)
- From: David Glass <email@hidden>
- Date: Thu, 23 Apr 2009 22:07:52 -0700
Greetings,
I have a script that does the following:
1. Watches a folder (attached as a folder action) for .avi files
2. Converts the .avi files to Apple TV format (.m4v) using QTPlayer
3. Imports the new .m4v file into iTunes
4. Sets the video type to TV Show
5. Deletes the original .avi file
Everything works perfectly *if* I save the script as an AppleScript
Debugger X file and step through the execution. If I save as a
'normal' AppleScript file, the execution terminates after doing
the .avi -> .m4v export in QTPlayer.
The fact that it works when I step through it makes me think it's a
timing issue, but I've done the following without success:
1. Added 'display dialog...giving up after 2' statements at numerous
locations (not displayed when running normally, which is odd to me)
2. Added 'delay 2' statements at numerous locations
3. Added the size checking routine I found on this list when searching
for issues with folder actions, to ensure the converted file is
actually ready
4. Added a 600 second timeout to the conversion step to verify it
wasn't timing out
All of this is pretty hit-and-miss as well, because sometimes the
folder action doesn't fire at all, sometimes it fires 5 seconds after
adding the file to the folder, and sometimes it fires immediately.
Any assistance would be greatly appreciated.
--
David Glass
_______________________________________________
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