Simple string searching in a text file

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

Moderator: Mr_Noodle

Re: Simple string searching in a text file Thu Aug 09, 2012 5:30 pm • by Mr_Noodle
Yes, break up the different parts of that line and echo the results. I forget where the output of stdout goes to but you can also try echoing to a temp file if you can't find it in Hazel's or the regular console logs.
Mr_Noodle
Site Admin
 
Posts: 11865
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Simple string searching in a text file Thu Aug 09, 2012 11:09 pm • by DBCooper
Problem solved!! :D

It turns out that the problem was that the path to the folder Hazel is scanning has a space in one of the folder names. That was causing the script to fail in Hazel even though the same command worked fine from the Terminal command line (where the spaces get escaped properly).

Here's the final, working version of the Hazel rule which includes quotes around the $1 to account for the spaces in the path.

Image

Thanks to a_freyer and Mr_Noodle for their patient assistance. Perhaps you could update your post in the tips forum with the quoted version of the script, a_freyer.
DBCooper
 
Posts: 20
Joined: Tue Aug 07, 2012 2:37 am

Re: Simple string searching in a text file Fri Aug 10, 2012 2:32 pm • by Mr_Noodle
D'oh! Should have suggested that first since that's a common problem. Glad you figured it out.
Mr_Noodle
Site Admin
 
Posts: 11865
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Simple string searching in a text file Wed Aug 15, 2012 11:33 am • by a_freyer
Mr_Noodle wrote:D'oh! Should have suggested that first since that's a common problem. Glad you figured it out.



Yeah, my bad too. I should have noticed that as well. Sorry about that OP! I updated the tips post per your suggestion.
a_freyer
 
Posts: 631
Joined: Tue Sep 30, 2008 9:21 am
Location: Colorado

Previous

Return to Support