Re: Scripting the unscriptable
Re: Scripting the unscriptable
- Subject: Re: Scripting the unscriptable
- From: Elliott Roper <email@hidden>
- Date: Wed, 27 Jan 2010 10:26:35 +0000
On 27 Jan 2010, at 07:04, John Baltutis wrote:
> On 1/26/10, Elliott Roper <email@hidden> wrote:
>> On 26 Jan 2010, at 21:31, Robert Poland wrote:
>>>
>>> Just a guess;
>>> Preview doesn't have a dictionary. And I suppose position may be a Finder
>>> command.
>>
>> Preview sure doesn't have a dictionary, that's what got me started on trying
>> to make a GUI script work.
>> Position is OK for window in the System Events dictionary, but bounds isn't.
>> Bill Cheeseman has just this instant put me on the right track in a private
>> mail.
>> Here is the working version:
>
>> if application "Preview" is running then
>> tell application "System Events"
>> tell application process "Preview"
>> set position of window 1 to {-1680, 0}
>> get name of window 1
>> set size of window 1 to {1680, 1050}
>> end tell
>> end tell
>> end if
>>
>> Size is a property of UI element of Application in the System Events Suite of
>> the System events dictionary
>
> What purpose does "get name of window 1" serve?
Debugging my understanding of what was going on; nothing else.
See upthread for a more finished one that actually works as intended.
I nested it inside an if block that tests if there is a window to resize, which is a bit less numpty.
_______________________________________________
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