• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: how can I stop a print job in OSX with AS? response
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: how can I stop a print job in OSX with AS? response


  • Subject: Re: how can I stop a print job in OSX with AS? response
  • From: Emmanuel <email@hidden>
  • Date: Mon, 21 Apr 2003 11:12:11 +0200

At 9:29 PM -0700 20/04/03, Tony wrote:
Thankyou very much for your message. It will take me a little while to use your suggested approach as I have no experience with the use of terminal but I shall look at it to see what I can do.

Let me propose my help here.

Like you, I need to run shell scripts. Actually I run tenths/hundreds of them daily. And I don't want to learn how to use Terminal. I have finally found that the AppleScript environment is better for me than Terminal to make up and run shell scripts.

1. you know that "do shell script(s)" launches "s" as if you had written that in Terminal. Thus, in your case, you could use a very small applet which would just do:

----------------------
do shell script "cancel -a" -- -a = all
----------------------

I did not test that, but from what I read in the documentation it should do what you want, like JB said.

2. the next step in order to be able to use shell scripts from AppleScript is to be able to run remotely "man", the command that provides the information about any command. I use Smile (we are the authors of Smile), and we propose "Getman", a tool for Smile (a User Script), available as a separate 3KB download, that prompts you for a command, and then displays the "man" for that command in a convenient text window.[1]

It's also good that you know that:

----------------------
do shell script "apropos 'foo bar'"
----------------------

retrieves the commands which are related to 'foo bar' (your search string here), and that the "man" of a command includes links to related commands, so once you get started with "apropos" you most probably find eventually what you're looking for.

For instance, you could run:

----------------------
do shell script "apropos 'cancel print job'"
----------------------

and find by yourself "lprm". Then you would get the "man" for "lprm" using "Getman", which suggests that your canceling applet or script could just be:

----------------------
do shell script "lprm"
----------------------

Emmanuel

[1] URL <http://www.satimage.fr/software/downloads/Getman.sit>
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • stop a print job in OSX ? re: lprm, whatis and cancel
      • From: Tony <email@hidden>
References: 
 >Re: how can I stop a print job in OSX with AS? response (From: Tony <email@hidden>)

  • Prev by Date: Re: alternate script syntax
  • Next by Date: Path to current script file?
  • Previous by thread: Re: how can I stop a print job in OSX with AS? response
  • Next by thread: stop a print job in OSX ? re: lprm, whatis and cancel
  • Index(es):
    • Date
    • Thread