Re: Testing for last process used
Re: Testing for last process used
- Subject: Re: Testing for last process used
- From: Brett Conlon <email@hidden>
- Date: Wed, 11 Jan 2006 17:03:31 +1000
Hi Daniel,
(just before I shoot off home)
Thanks for your suggestion. Just enquiring:
is that "\t" the character for tab? Are you essentially using
Command-tab? Could I have used "keystroke tab
using command down"?
It's a great idea. I'll see how I can
impliment it in my script tomorrow. The only possible setback would be
if someone was in, say, Safari, then went to the desktop and double clicked
on the bundle app to launch it (instead of dropping files on it). For such
instances I could then have the script test the previous app to see if
it was FreeHand or XPress and if so just run the print bits, otherwise
it would bring up a choose file window to open a desired file.... that
might work.
Lotsa bandaids, spit and snot to get
it working but a working solution none-the-less. ;-}
Coj
ps. Because of FH & QXP's poor Print
AS implimentation I've had to heavily rely on UI scripting, so everyone's
Mac has the necessary UI bits enabled.
Daniel Jalkut <email@hidden>
11/01/06 05:37 PM
|
To
| Brett Conlon <email@hidden>
|
cc
| applescript <email@hidden>
|
Subject
| Re: Testing for last process used |
|
Brett - would it help to be able to "get back to"
the previous application from your script? If so, it occurred to
me that you might be able to use UI scripting. You could fabricate
the keystrokes to take advantage of the Dock's knowledge of "last
application". Especially if you what you want to do is simply
switch back to the previous app to do something. For instance, here's an
example script that may help:
tell application "System Events"
set currentAppName to name of first application process
whose frontmost is true
keystroke "\t" using command down
set lastAppName to name of first application process whose
frontmost is true
keystroke "\t" using command down
end tell
display dialog "We're in app " & currentAppName
& " and used to be in " & lastAppName
Of course, you'd have to have your users enable UI scripting.
Daniel
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden