Re: Option key down in Yosemite
Re: Option key down in Yosemite
- Subject: Re: Option key down in Yosemite
- From: Robert Poland <email@hidden>
- Date: Thu, 02 Oct 2014 07:46:55 -0600
On Oct 2, 2014, at 7:11:AM, Shane Stanley <email@hidden> wrote:
> 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
This failed to compile with Mavericks/Smile.
> That might even deal with cases where you have multiple versions of an app running.
>
> --
> Shane Stanley <email@hidden>
> <www.macosxautomation.com/applescript/apps/>
>
> _______________________________________________
> 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
Robert Poland
Fort Collins CO
_______________________________________________
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