Shell and Applescripts failing to execute

Hi, I've been using Hazel for ~18 months, and really like it, so much that I didn't mind paying for the recent upgrade.
I recently migrated from Snow Leopard to Mountain Lion and am rewriting some old Hazel rules and coding some new ones. I'm also having a problem I never had before: Hazel is failing to execute scripts.
I've seen a lot of posts in the forums about scripts working in Terminal and not when called by Hazel; I've seen the advice about making sure you source your .bashrc, etc., and followed it all. I even tried reinstalling Hazel for all users (rather than the active user).
Well, none of that advice has worked.
I gave up on getting the shell script to work, so I decided to try the (apparently popular) workaround and write an Applescript to open the Terminal, then execute the script from there. That's not working either.
The Applescript to open the Terminal and execute the script works—except when I call it in Hazel.
Likewise, the shell script itself works—except when I call it in Hazel.
The Hazel logs say nothing; they don't say the script succeeded or that it failed, they just say that the folder was processed.
It's a really simple script, triggered by a time variable (although I've been testing it by running the rule manually).
Here's the AppleScript:
Here's the script itself, targeting Storify's RESTful API:
Any ideas?
Could it be something to do with the fact that the Hazel rule doesn't interact with any particular file but is merely triggered by the time? I don't know, I'm grasping at straws…
Anyway, I suspect this is an issue with Hazel, because I've tried pretty much everything approaching a solution in the forums. I just want to automate a simple script from my Mac without writing my own Launchd code or resorting to Lingon, which is by all accounts now quite broken and crippled; and use cases like this are why I bought Hazel instead of some open source alternative.
Thanks!
I recently migrated from Snow Leopard to Mountain Lion and am rewriting some old Hazel rules and coding some new ones. I'm also having a problem I never had before: Hazel is failing to execute scripts.
I've seen a lot of posts in the forums about scripts working in Terminal and not when called by Hazel; I've seen the advice about making sure you source your .bashrc, etc., and followed it all. I even tried reinstalling Hazel for all users (rather than the active user).
Well, none of that advice has worked.
I gave up on getting the shell script to work, so I decided to try the (apparently popular) workaround and write an Applescript to open the Terminal, then execute the script from there. That's not working either.
The Applescript to open the Terminal and execute the script works—except when I call it in Hazel.
Likewise, the shell script itself works—except when I call it in Hazel.
The Hazel logs say nothing; they don't say the script succeeded or that it failed, they just say that the folder was processed.
It's a really simple script, triggered by a time variable (although I've been testing it by running the rule manually).
Here's the AppleScript:
- Code: Select all
tell application "Terminal"
do script "/path/to/script.sh"
delay 30
quit
end tell
Here's the script itself, targeting Storify's RESTful API:
- Code: Select all
#!/bin/bash
NOW=$(date +"%Y-%m-%d")
curl -d "api_key=XXXXXXXXXX&username=XXXXX&password=XXXXXX&story={\"title\":\"${NOW}\"}&publish=true" http://api.storify.com/v1/stories/XXXX/create
Any ideas?
Could it be something to do with the fact that the Hazel rule doesn't interact with any particular file but is merely triggered by the time? I don't know, I'm grasping at straws…
Anyway, I suspect this is an issue with Hazel, because I've tried pretty much everything approaching a solution in the forums. I just want to automate a simple script from my Mac without writing my own Launchd code or resorting to Lingon, which is by all accounts now quite broken and crippled; and use cases like this are why I bought Hazel instead of some open source alternative.
Thanks!