1

I managed to make Firefox to follow specific protocol links (oxygen:/...) and use an application to open them. As the Mac OS X oXygen XML Developer app doesn't accept arguments, I need to use a shell script that is shipped together with oXygen itself. Given Firefox doesn't like shell scripts, I needed to write an Automator application 'Run Shell Script'. As I was having trouble to get it to work, I decided to use a stub code, with osascript, just to debug variables.

My current script looks like:

osascript -e 'display alert "'"$1"'"'

and it is defined as a bash script, receiving data as arguments.

When I click the link the dialog of osscript appears, but with an empty message. So, I am not sure how the URL is being passed to the application itself. I tried, also, with receiving data as stdin, but with no lock. I got to the point of writing a script that dumped all the parameters and STDIN to a file, but it ends up always empty.

Thank you for any hint.

4ae1e1
  • 7,228
  • 8
  • 44
  • 77
Alberto
  • 499
  • 4
  • 23
  • If I use it from the command line, it works (open -a /path/to/automator/app --args argument1). But not when connecting from Firefox. I wonder how firefox is passing the URL. – Alberto Nov 14 '15 at 21:27
  • I'm not sure about the Automator input either, but you might want to try making an AppleScript application with URL handler as described in [this answer](http://stackoverflow.com/a/3704396/1944784). Then inside your AppleScript you could use the [`do shell script`](https://developer.apple.com/library/mac/documentation/AppleScript/Conceptual/AppleScriptLangGuide/reference/ASLR_cmds.html#//apple_ref/doc/uid/TP40000983-CH216-SW40) command and pass your handled URL to a bash script. It's convoluted, but I don't know anything better. – 4ae1e1 Nov 14 '15 at 21:36

0 Answers0