Feb. 22nd, 2007

pasithea: glowing girl (Default)
Go ahead. Google search. Just TRY to find a reference page for Applescript programming. I DARE you.

I spent my whole evening futzing with voice commands for photoshop and illustrator. I wonder if I'll ever do enough keypresses in them to pay off the eight hours I just spent doing the scripting.

Of course, the frustrating thing was that I wanted to de fairly basic simple stuff and it's completely totally undocumented.

Like okay... Often you get a dialog box that has an OK or Cancel.

In theory, the code looks like this:
tell current window click button "OK"

Of course, that doesn't actually work. In fact, I couldn't get any of the 'click button' type commands to work (though I was able to get menu items to basically work)

Anyhow. For 90% of my stuff,
tell application "System Events" to keystroke return
works well enough for most OK cases and it's just generally handy anyhow.

Now Cancel...
There is no 'keystroke escape' and something clever like 'keycode 27' (The ASCII value for escape) also doesn't work.

Ugh. I spent hours on this. As common as the OK and Cancel buttons are, you'd THINK there'd be a well-defined handler for them that everyone uses but tons and tons of searching lead me to the conclusion that everyone who uses applescript has this problem and no one has a solution to it.

I finally discovered that CTRL-OPT-APPLE-[ works like cancel for the few most irritating Photoshop windows.

Speaking of Photoshop... It has it's own library of applescript commands you can use in it and it's just as poorly documented as Applescript itself.
While I fairly quickly figured out how to create a new layer, name it, and set its transparency mode with a single voice command (which is cool) I had NO LUCK at all finding a way to LOCK a layer. The word 'lock' isn't even mentioned in the applescript document for Photoshop. I can toggle the visibility, swap the order of the layers, monkey with the channels, but there is no info ANYWHERE on how to lock the layer with applescript (or Java script or Visual Basic, I would have adapted!)

So that's been my evening. Those two things were just maddening. Everything else went together without too much fuss, and I think it really is going to work out well for me. Nothing slows me down like fumbling for keys and trying to remember where something was in some menu.

I really do wish AppleScript was better documented though. Just a list of commands and valid parameters. That's all I'm asking for here. I can figure out what they do, but without knowing the commands, it's a real pain in the ass!
pasithea: glowing girl (Default)
BTW, if anyone is interested:

http://circle.twu.net/progs/speakable.tar.gz contains my speech commands for Illustrator and Photoshop. Follow the lifehacker directions from the previous post to install them or taylor them to your needs.

Thanks to Peggy for mentioning there was a thing about key codes on lifehacker. I followed that, got a program, and from that, was able to get a keycode for ESC that would work properly for all cases. I also fixed my lock layer problem since the docs are now there for Photoshop.

The AI hacks all just use basic applescript. For the Photoshop hacks, some of them use PS7.0 applescript calls. You have to install the applescript stuff for your PS install before you can use them, and the syntax for some of it may have changed before or since 7.0 MOST of it will work without problem though.

Enjoy!
pasithea: glowing girl (Default)
I haven't had a computer crash in a while. I'm past due.

Before that happens, I should probably figure out some good way of synching certain directories between my notebook and tower.

Anyone have any good suggestions for the Mac? Here's basically all I want:

Synchronization
An easy way to say 'The directory is the same as this directory on the other machine. Copy newer versions of files from one to the other so that both have a copy'

Backup
And a way to say, 'Take all the new files from this directory on this computer and copy them to a backup directory on the other computer.'

Oh yeah. A way to synch address books between my desktop, notebook, and cell phone might also be nice. :)


In other news, voice-commands are addictive. Frequently when I am reading LJ, someone has linked to something with sound and I have to find iTunes and turn off its volume (since I listen to streams, this is often better than stopping the current stream as they have reconnect messages and a delay)

So now, I just say, 'Switch to iTunes' followed by 'Mute' or 'Unmute'. Turns the volume for the track to 0 and back again. :) Yay technology!
pasithea: glowing girl (Default)
A little more fooling around with AppleScript today and then my first pieces of work produced using voice assistance. Not very complex pieces, in fact, both are sketches that'd been sitting in my temp directory since July of 2005 (I cleaned up my drives today too) but suitable as test subjects.

So far, this experiment is feeling extremely successful. Workflow feels much more natural than hitting the palette and switching tools all the time. I can keep my pen right where I am working which makes for more accurate continuations and just overall makes things a lot faster.

Not as big a gain in Photoshop as in Illustrator, of course. OMFG, how have I lived without voice command for Illustrator!?!? 'Move layer up/down/to top/to bottom' are awkward key combinations, and going back and forth between 'vertex select', 'pen', 'scissors', and hitting 'join', and especially killing that F***ing window that pops up after join if you miss. This is working SO much faster it's just amazing!

I'm doing a mix of some voice commands and some left-hand commands. Holding down the CTRL and SHFT keys, for instance. Tomorrow I'll see about doing a bit more complex piece using my new setup. (Now that I'm mostly done futzing with it. :)

Sample art behind cut )

February 2012

S M T W T F S
   1234
567891011
12 131415161718
19202122232425
26272829   

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jan. 1st, 2026 01:21 am
Powered by Dreamwidth Studios