in reply to Can files with extension ".command" on MacOSX be perl scripts? What is a way to let users execute Perl scripts on macosx from Finder?

What I would really like is to be able to use any executable script (Perl, bash, etc.) as a Mac OS "Speakable Item." Speakable Items are simply scripts with a filename you can say out loud. If the user says the filename, the script is executed.

Some rules allow only certain scripts in certain directories to be monitored with the voice recognition subsystem. As far as I can tell, there are only two kinds of Speakable Items: an AppleScript .app, or a special text file which indicates that the functionality is built into the voice recognizer itself (such as the Knock Knock joke engine).

I would like a pile of Speakable Items, but the overhead of wrapping each .pl into .app files is quite a chore. I would also like a certain "Speakable Items" folder to be active when the login prompt is on the screen (with all the caveats of not allowing any GUI interaction, and installed only by sudo, etc). I've recommended this to Apple, and I hope Tiger shows some growth in that area, but I don't hold much hope.

--
[ e d @ h a l l e y . c c ]

  • Comment on Re: Can files with extension ".command" on MacOSX be perl scripts? What is a way to let users execute Perl scripts on macosx from Finder?

Replies are listed 'Best First'.
Re^2: Can files with extension ".command" on MacOSX be perl scripts? What is a way to let users execute Perl scripts on macosx from Finder?
by merlyn (Sage) on Feb 14, 2005 at 18:09 UTC
    I think you can use a compiled applescript. And a compiled applescript can include
    do shell script "/some/unix/command with args | here to | there >outpu +t";
    so it might be inconvenient, but at least you can fire your arbitrary script this way.

    -- Randal L. Schwartz, Perl hacker
    Be sure to read my standard disclaimer if this is a reply.

      I'll have to give that a try, merlyn, but if we're missing a mechanism akin to the shell $0 argument, it'll be hard to make a single generic AppleScript that chains over to a number of Perl behaviors.

      --
      [ e d @ h a l l e y . c c ]