[MacTUG] SafariFullScreen but not "Full Screen"

Dani Roloson daroloso at uwaterloo.ca
Tue Apr 28 16:21:43 EDT 2015


http://macscripter.net/viewtopic.php?id=22413
is a forum thread "Strech (sic) any front window to maximum size"
which is 8 years old but does caution that some apps may not play nice.
________________________________
From: mactug-bounces at lists.uwaterloo.ca [mactug-bounces at lists.uwaterloo.ca] on behalf of Dani Roloson [daroloso at uwaterloo.ca]
Sent: April 28, 2015 12:00
To: MacTUG
Subject: [MacTUG] SafariFullScreen but not "Full Screen"


So the following AppleScript is specific to my monitors

and Safari (but that can be fixed by removing the tell/end tell)


It could be the starting for a left/right/top/bottom half as well.

Probably want an Automator Service so in contextual menus

and can be assigned a keyboard shortcut.


-- figure out your bounds for each display after manually sizing a window

--

-- tell application "Safari"

-- get bounds of front window

-- end tell

--

-- {0, 22, 1919, 1032} -- main display (22 is for menu bar)

-- {1920, 0, 3520, 1200}  -- second display (not running 10.10 so no menu bar)


tell application "Safari"

set screenResolution to bounds of front window

set xAxis to item 1 of screenResolution

if xAxis < 1920 then

set the bounds of the first window to {0, 22, 1919, 1032}

else

set the bounds of the first window to {1920, 0, 3520, 1200}

end if

end tell

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.uwaterloo.ca/pipermail/mactug/attachments/20150428/d8552d56/attachment.html>


More information about the MacTUG mailing list