I've known about this, both the fake-keystrokes and the Scripts
folder, for a while.  What I don't understand, and what would be more
useful to me, is how to write an actual _action_ for QS, that shows up
in the _second_ pane and perhaps opens a third pane as well.  For
instance, I'd like to write a "copy as..." action that takes a file
(pane 1) and a folder (pane 3), then asks for a new filename (somehow—
AppleScript query box?) and does a copy-and-rename in one operation.
Or an "alias as..." action that does the same, only making an alias.
Some simple stuff like that, plus maybe some text processing.

Anyone know how?  Something with "using terms from," but I don't know
enough AppleScript to puzzle it out from examples.

On Sep 19, 10:46 am, Chris Cairns <[EMAIL PROTECTED]> wrote:
> thanks to you.......i wrote my first applescript. see 
> here:http://groups.google.com/group/blacktree-quicksilver/browse_thread/th...
>
> On Sep 19, 5:52 pm, Sesquipedalian <[EMAIL PROTECTED]> wrote:
>
> > Oh, I forgot to say that when you have made a script that does what
> > you want, save it in the Scripts folder of your user Library folder,
> > and QS will add it to the catalogue (unless you've changed the default
> > catalogue settings).
>
> > On Sep 19, 12:54 am, Sesquipedalian <[EMAIL PROTECTED]> wrote:
>
> > > Applescript is really easy to use. Even if you know nothing about it,
> > > you can at the very least write a script to simulate keystrokes for
> > > you so that you can execute a whole series of actions with a single
> > > trigger in QS.
>
> > > Telling Applescript to simulate keystrokes for you is as simple as
> > > opening Script Editor.app and entering something like this into it:
>
> > > tell application "System Events" to keystroke "P" using {command down}
>
> > > This line of code will press ⌘P for you. You can string a series of
> > > keystrokes together using code like this:
>
> > > tell application "System Events"
> > >    keystroke "A" using {command down}
> > >    keystroke "S" using {command down, option down}
> > >    keystroke "1"
> > >    keystroke ";" using {shift down}
> > >    keystroke ":"
> > > end tell
>
> > > The first keystroke is ⌘A, the second is ⌘⌥S, the third is simply 1,
> > > and the fourth and fifth both type a colon, since holding the shift
> > > key makes the semicolon key type a colon.
>
> > > Now, so far we have only tried typing letters, numbers, and
> > > punctuation. What if you want to press an arrow key, the return key, a
> > > function key, etc.?
>
> > > Instead of the "keystroke" command, use the "key code" command.  That
> > > will allow you to press just about any key on the keyboard.  Here is
> > > an example:
>
> > > tell application "System Events" to key code 35 using {command down}
>
> > > This line of code also presses ⌘P for you. 35 is the actual numeric
> > > code for the P key. You can learn the key code for any key on your
> > > keyboard by downloading a little app called Full Key Codes 
> > > fromhttp://softwares.bajram.com/utilities/.  Open this app, press any key,
> > > and it will show you the key code in blue in the lower right corner of
> > > its window. (It will also show you some other information, but you can
> > > ignore the rest.) Use that code number in your Applescript, and you
> > > can simulate just about any series of keyboard commands you want.
>
> > > As a note of explanation, the reason these commands always start with
> > > 'tell application "System Events"' is because only the background
> > > process named System Events can simulate pressing keys on your
> > > keyboard. As you start learning Applescript, you will discover that
> > > many applications can each be told to do many different things.

Reply via email to