Re: AppleScript for resizing/repositioning Preview document windows
Re: AppleScript for resizing/repositioning Preview document windows
- Subject: Re: AppleScript for resizing/repositioning Preview document windows
- From: Laine via AppleScript-Users <email@hidden>
- Date: Sun, 22 Oct 2023 20:06:05 -0500
I’m not able to test in Ventura anymore, but it appears to work OK in Sonoma
(latest public beta), in case that's something to look forward to. I tried
Sonoma on one machine for a couple of days, and it seemed OK, so now it’s the
only recent system I have. Anyway, I probably wouldn’t perform another “tell"
inside “Preview”’s tell block. Did you try something like this (I played with
the bounds):
tell application "Preview"
activate
set _theWindows to every window
repeat with i from 1 to number of items in _theWindows
set this_item to item i of _theWindows
set the bounds of this_item to {0, 0, 1111, 1600}
end repeat
end tell
delay 1
tell application "System Events"
keystroke "g" using {option down, command down}
keystroke 14
delay 1.5
keystroke return
end tell
tell application "Preview"
activate
set the bounds of window 1 to {200, 0, 720, 940}
end tell
L. Lee
> On Oct 22, 2023, at 6:33 PM, Barry Fass-Holmes via AppleScript-Users
> <email@hidden> wrote:
>
> Hello!
>
> The script below functioned properly under macOS Monterey, but now under
> Ventura it does not.
>
> The open document windows do not resize at all. I’ve experimented with the
> last two values in the bounds statements, but the windows remain at the same
> size as when Preview launched and the documents reopened from the last
> session (as if the bounds statement did not process at all).
>
> How can I fix the script so that it functions properly under Ventura? Many
> thanks in advance.
>
> Barry
>
> tell application "Preview"
> activate
> set _theWindows to every window
> repeat with i from 1 to number of items in _theWindows
> set this_item to item i of _theWindows
> set the bounds of this_item to {0, 0, 720, 940}
> end repeat
> delay 1
> tell application "Preview" to activate
> tell application "System Events"
> keystroke "g" using {option down, command down}
> keystroke 14
> delay 1.5
> keystroke return
> end tell
> set the bounds of window 1 to {200, 0, 720, 940}
> end tell
> _______________________________________________
> 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
_______________________________________________
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