Re: Option key down in Yosemite
Re: Option key down in Yosemite
- Subject: Re: Option key down in Yosemite
- From: Shane Stanley <email@hidden>
- Date: Thu, 02 Oct 2014 23:11:19 +1000
On 2 Oct 2014, at 10:54 pm, 2551 <email@hidden> wrote:
Can you get it any shorter
No, but perhaps sweeter. You said:
tell application "System Events" set frontapp to (name of processes whose frontmost is true) as string end tell
tell application frontapp
Getting a list and coercing it to text is inefficient, and always risky because of text item delimiters. "name of process 1" would be better; no list involved.
But more to the point, you're assuming the application name is the same as the process name, and there are plenty of cases where that's not the case.
So you might be better off using something like:
tell application "System Events" set frontapp to (file of process 1 whose frontmost is true) as text end tell
tell application frontapp set zoomed of window 1 to not zoomed of window 1 end tell
That might even deal with cases where you have multiple versions of an app running.
--
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden