Quantcast
Channel: Objective Development Forums
Viewing all articles
Browse latest Browse all 4524

Can LB inject the stdout of a shell script like a snippet

$
0
0
I have read the page on unix executables more times than I want to admin. Right now, in an app called Keybord Maestro, I have shell script that is bound to the key command "..date", any time I type that it is replaced with 08/21/14 — 07:57:44 AM. I use it all the time to time stamp a file I am working on.

I want to use LB for this instead, so I made a simple shell script. Right now it lives in ~/Library/Application\ Support/LaunchBar/Actions/ and I am calling it `datey`

That is a goof place to start, does LB care about syntax, or is there some magic that goes on where it is just piping date from the command in and out. For example, I can do this:
echo `date` or the much more POSIX war echo $("date")

Here are the contents of `datey`
#!/bin/sh
/bin/echo $(/bin/date "+%D - %r")


It shows up in the index, but when I call it nothing happens. I have looked everywhere for log, and can't figure out where LB logs to, does anyone know, or know how to create a repeatable error so I can look for the log that lists that error?

I have the permissions coronet: -rwxr-xr-x 1 me staff 43 Aug 20 17:48 datey\

Running it from the command line works fine:
$./datey
08/21/14 - 08:04:49 AM

That leads me to a question. Commands that need rot privs, how do we deal with that in LB aside from making a mess of Applescript and adding the "with administrator privileges".

So now I am stumped, I want to know if this script is even running when LB asks it to. I add in a touch ~/Desktop/LB-ran-the-script.txt and added that as the last line of the script. Sure enough, when I ran the script from LB, a file called "LB-ran-the-script.txt" appeared on my desktop.

This tells me permissions are ok, the index is picking it up, the shell script is ok, and error free.

Is there a return code I need to enable, a preference?> Maybe I need to exit 1 or LB things the script is not finished?

Suggestions? Working shell script but i don't know how to tell the output to go where the cursor is.

Viewing all articles
Browse latest Browse all 4524

Trending Articles