Thursday, October 6, 2022

#1 2005-10-13 02:26:34 pm

From:: Malasaña, Madrid
Registered: 2002-11-20
Posts: 2014

How do I script the Chooser?

Much to the dismay of many, the Chooser is not scriptable. But thanks to scripting additions, there is a way to work around it. Look into the freeware S�¤ndi's Additions, which includes the command "type text" and allows simulated typing on the keyboard.

Suppose you wanted to choose a printer named "LaserWriter Select 360" in the Chooser.


tell application "Finder"
   open file ((path to apple menu items folder as text) & "Chooser")
   type text "L" -- selects the LaserWriter 8 icon
   type text tab -- move to the printer choices
   type text "LaserWriter Select 360 " -- selects the driver
   type text "q" holding down command -- quit the Chooser
   type text return -- to okay the choice
end tell

The printer has been chosen!

Filed under: Finder



Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)