Re: System Events: window id's instead of window names?
Re: System Events: window id's instead of window names?
- Subject: Re: System Events: window id's instead of window names?
- From: Thomas Fischer <email@hidden>
- Date: Tue, 22 Jun 2010 16:41:15 +0200
Am 22.06.2010 um 16:11 schrieb Deivy Marck Petrescu:
>> I'm not quite clear what you are trying to achieve.
>> But from short testing, my impression is that "process" windows don't have ids, while application windows do.
>> So for example
>>
>> tell application "System Events"
>> get id of window 2 of application "TextEdit"
>> end tell
>>
>> works for me (10.6.4), while
>>
>> tell application "System Events"
>> get id of window 2 of process "TextEdit"
>> end tell
>>
>> yields an error.
>> Does this help in any way?
> Thomas,
> You got the id of the window because TextEdit is scriptable and might (it does in this case) have "id" as its window's property.
> If you try your script with a non-scriptable app, you will get an error.
I agree, but my point was that even if the application is scriptable, there is no
id of window 2 of process "TextEdit"
while there is one for
window 2 of application "TextEdit".
I'm wondering if something like
tell application "System Events"
set myProcess to (name of first process whose frontmost = true and visible = true)
set ws to windows of process myProcess
set {width, height} to {screenWidth / (count ws), screenHeight}
repeat with i from 1 to count ws
set {position of window i of myProcess, size of window i of myProcess} to {{(i - 1) * width, 0}, {width, height}}
end repeat
end tell
would do the job.
And here I have the problem how I can test a script that refers to the font window: when I'm scripting, this is alway Script Editor...
Best
Thomas
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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