Page 1 of 1
Shell script for Hazel & OpenMeta & Echo

Posted:
Sun Jul 26, 2009 8:32 pm
by patchling
Decided to live dangerously and use OpenMeta. I want to run a shell script that asks for input and then tags downloaded files with OpenMeta. My question isn't really about that process, rather about running a script that asks for input -
#!/bin/bash
echo "Tags to append:"
read answer
echo $answer
openmeta -a $answer -p path_to_file
But it doesn't ask me for input, or echo the "answer".
Hoe do I get this to work?
Re: Shell script for Hazel & OpenMeta & Echo

Posted:
Mon Jul 27, 2009 2:36 pm
by Mr_Noodle
There is no interactive shell so it's not clear to me where you expect input to be read from. You probably need to do this in AppleScript to bring up a dialog. Poke around as I believe there are examples of that around.
Re: Shell script for Hazel & OpenMeta & Echo

Posted:
Mon Jul 27, 2009 3:39 pm
by sjk
Would it make any difference if the script
hashbang used
#!/bin/bash -i to force the shell to be interactive?
Re: Shell script for Hazel & OpenMeta & Echo

Posted:
Tue Jul 28, 2009 8:34 am
by Mr_Noodle
The problem is that you need a GUI to type into. As odd as it may seem, you need some interface to access the commandline, Terminal being the most obvious. But if you have something in the background, you need to have something hosting an interface to present to the user (and subsequently read stuff back in).
There might be some commandline program to bring up a GUI dialog so you can try searching for that but otherwise AppleScript is the way to go.
Re: Shell script for Hazel & OpenMeta & Echo

Posted:
Tue Jul 28, 2009 4:04 pm
by sjk
Mr_Noodle wrote:The problem is that you need a GUI to type into.
D'oh, of course!
There might be some commandline program to bring up a GUI dialog so you can try searching for that but otherwise AppleScript is the way to go.
I'll leave that to patchling, if (s)he's interested.
