Shell script for Hazel & OpenMeta & Echo

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

Moderator: Mr_Noodle

Shell script for Hazel & OpenMeta & Echo 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?
patchling
 
Posts: 1
Joined: Fri Jun 26, 2009 10:37 pm

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.
Mr_Noodle
Site Admin
 
Posts: 11240
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Shell script for Hazel & OpenMeta & Echo 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?
sjk
 
Posts: 332
Joined: Thu Aug 02, 2007 5:43 pm
Location: Eugene

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.
Mr_Noodle
Site Admin
 
Posts: 11240
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Shell script for Hazel & OpenMeta & Echo 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. :)
sjk
 
Posts: 332
Joined: Thu Aug 02, 2007 5:43 pm
Location: Eugene


Return to Support