AppleScript won't run from Hazel

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

AppleScript won't run from Hazel 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.
deoxyribonic
 
Posts: 1
Joined: Sun May 12, 2013 4:09 pm

Re: AppleScript won't run from Hazel 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?
sjk
 
Posts: 332
Joined: Thu Aug 02, 2007 5:43 pm
Location: Eugene

Re: AppleScript won't run from Hazel Mon May 13, 2013 12:38 pm • by Mr_Noodle
What is the error?
Mr_Noodle
Site Admin
 
Posts: 11865
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support