[MacTUG] SafariFullScreen but not "Full Screen"

Dani Roloson daroloso at uwaterloo.ca
Tue Apr 28 12:00:24 EDT 2015


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/dc0e07c2/attachment.html>


More information about the MacTUG mailing list