Page 1 of 1

How to Test Hazel AppleScripts in AppleScript Editor

PostPosted: Tue Feb 05, 2013 1:45 am
by n8henrie
This is probably old news for those of you that know a thing or two about AppleScript, but it's been helpful to me.

After quite a bit of testing and trying different techniques, I think I finally found the easiest way to test how Hazel will process a given file by running it through AppleScript Editor with this snippet at the top:
Code: Select all
property theFile : alias "Path:To:Your:Example File.extension"


That's for embedded AppleScripts. For external ones, also include this after that:

Code: Select all
hazelProcessFile(theFile)
 
on hazelProcessFile(theFile)
--Your external Hazel script goes here.
end hazelProcessFile


I wrote this up as a brief blog post here: http://n8henrie.com/2013/02/how-to-test-hazel-applescripts-in-applescript-editor/ but I figured it might also do some good for me to post it here in the tips and tricks forum, as I know I've spent plenty of time digging through these threads.

Hope this helps someone!

Re: How to Test Hazel AppleScripts in AppleScript Editor

PostPosted: Tue Apr 02, 2013 2:20 pm
by a_freyer
While this is great, I find that it is kind of a pain to test against multiple different files.

I do this:

Code: Select all
set theFile to choose file


To select my own files.