Page 1 of 1

AppleScript won't run from Hazel

PostPosted: Sun May 12, 2013 4:17 pm
by deoxyribonic
I have a rule set up to run the following AppleScript if a new file is added to a folder:

Code: Select all
set statePath to POSIX path of (theFile)
set watch to "file://" & statePath
tell application "VLC"
   OpenURL (watch)
end tell


However it throws an error, yet this script

Code: Select all
property theFile : alias "MEDIA:Videos:VideoFile.mp4"
set statePath to POSIX path of (theFile)
set watch to "file://" & statePath
tell application "VLC"
   OpenURL (watch)
end tell


Runs perfectly from the AppleScript Editor. Why is this? And yes, MEDIA:Videos:VideoFile.mp4 is the file it's being run on.

Re: AppleScript won't run from Hazel

PostPosted: Sun May 12, 2013 5:02 pm
by sjk
Would it work to use Hazel's built-in Open with application … action instead of the external script?

Re: AppleScript won't run from Hazel

PostPosted: Mon May 13, 2013 12:38 pm
by Mr_Noodle
What is the error?