I followed a post in the Recepie Exchange for automatically converting MKVs/AVIs etc to m4v files with an applescript that I have asked Hazel to launch. It was all working perfectly, flowing from folder to folder, then one day, Hazel would not complete a rule that called an applescript.
The rule said that if any file was an mkv or avi file, coloured Blue, and was not modified in the last 5 mins, then launch an external script.
- Code: Select all
on hazelProcessFile(theFile)
tell application "Finder"
try
--Set to red label to indicate processing
set label index of theFile to 2
--Assemble original and new file paths
set origFilepath to quoted form of POSIX path of (theFile as alias)
set newFilepath to (characters 1 thru -5 of origFilepath as string) & "m4v'"
--Start the conversion
set shellCommand to "nice /Applications/HandBrakeCLI -i " & origFilepath & " -o " & newFilepath & " --preset=\"Normal\" ;"
do shell script shellCommand
--Set the label to orange
set label index of theFile to 3
end try
end tell
tell application "Finder"
set movieName to name of item theFile
end tell
tell application "GrowlHelperApp"
set the allNotificationsList to {"Handbrake convert complete"}
set the enabledNotificationsList to {"Handbrake convert complete"}
register as application "Handbrake Encode Growler" all notifications allNotificationsList default notifications enabledNotificationsList icon of application "HandBrake"
notify with name "Handbrake convert complete" title "Handbrake conversion complete" description "The video \"" & movieName & "\" has been converted." application name "Handbrake Encode Growler"
end tell
end hazelProcessFile
My Growl notification would pop up and tell me that the file had been complete. But it hadnt.
So i tried to simplify the rule and said if any file is labelled Blue, run this script. I forced the rule to run, and the same result..it bypassed Handbrake CLI.
I use the same script on another machine, and it works fine.
I have since repaired permissions, changed an read/write settings in the file info to read/write all users but still nothing.
In the end, i guess its not really a Hazel issue, as Hazel is working beautifully on my machine with other rules and i really cant wait for version 3 to come out, but has anybody come accross this kind of thing and offer any suggestions to fix it.
Thanks in advance.