activate application \"Safari\"
tell application \"System Events\"
tell process \"Safari\"
keystroke \"b\" using {command down, shift down}
keystroke \"|\" using command down
end tell
end tell
tell application \"System Events\"
tell application \"Safari\" to activate
tell process \"Safari\"
try
click menu item \"Hide Bookmarks Bar\" of menu \"View\" of menu bar 1
click menu item \"Hide Toolbar\" of menu \"View\" of menu bar 1
on error
click menu item \"Show Bookmarks Bar\" of menu \"View\" of menu bar 1
click menu item \"Show Toolbar\" of menu \"View\" of menu bar 1
end try
end tell
end tell
tell application \"Safari\"
activate
if bounds of window 1 is not equal to {0, 22, 1280, 800} then
tell application \"System Events\"
keystroke \"b\" using {command down, shift down}
keystroke \"|\" using command down
keystroke \"/\" using command down
keystroke \"t\" using {command down, shift down}
end tell
set bounds of window 1 to {0, 22, 1280, 800}
else
tell application \"System Events\"
keystroke \"b\" using {command down, shift down}
keystroke \"|\" using command down
keystroke \"/\" using command down
keystroke \"t\" using {command down, shift down}
keystroke \"m\" using {control down, option down, command down}
click button 2 of window 1 of process \"Safari\"
end tell
end if
end tell
-- This script makes a Safari window the size of the desktop, or toggles it to a more reasonable size by pressing the \"Zoom\" button.
-- The size of the screen is hard coded to the size of the desktop minus the menu bar. If we try to detect the size of the screen, the returned value is the entire screen. The menu bar is not taken into account, and we never get to the 'else' side of the conditional. We could detect the other coordinates, but what's the point. ...cb
tell application \"Safari\"
activate
-- check to see if Safari is already as big as it can be on a 1280x800 screen
if bounds of window 1 is not equal to {0, 22, 1280, 800} then -- go as big as you can
-- from: http://www.macosxhints.com/article.php?story=20060921045743404
tell application \"System Events\"
tell process \"Safari\"
tell menu bar 1
tell menu bar item \"View\"
tell menu \"View\"
click menu item \"Hide Bookmarks Bar\"
click menu item \"Hide Status Bar\"
click menu item \"Hide Tab Bar\"
click menu item \"Hide Toolbar\"
end tell
end tell
end tell
end tell
end tell
set bounds of window 1 to {0, 22, 1280, 800}
else
tell application \"System Events\" to click button 2 of window 1 of process \"Safari\" -- push the green button. It's a quick way to get a moderate size window.
-- opposite of above
tell application \"System Events\"
tell process \"Safari\"
tell menu bar 1
tell menu bar item \"View\"
tell menu \"View\"
click menu item \"Show Bookmarks Bar\"
click menu item \"Show Status Bar\"
click menu item \"Show Tab Bar\"
click menu item \"Show Toolbar\"
end tell
end tell
end tell
end tell
end tell
end if
end tell
-- This script makes a Safari window the size of the desktop, or toggles it to a more reasonable size by pressing the \"Zoom\" button.
-- The size of the screen is hard coded to the size of the desktop minus the menu bar. If we try to detect the size of the screen, the returned value is the entire screen. The menu bar is not taken into account, and we never get to the 'else' side of the conditional. We could detect the other coordinates, but what's the point. ...cb
tell application \"Safari\"
activate
-- check to see if Safari is already as big as it can be on a 1280x800 screen
if bounds of window 1 is not equal to {0, 22, 1280, 800} then -- go as big as you can
-- from: http://www.macosxhints.com/article.php?story=20060921045743404
tell application \"System Events\" to tell process \"Safari\" to tell menu bar 1 to tell menu bar item \"View\" to tell menu \"View\"
click menu item \"Hide Bookmarks Bar\"
click menu item \"Hide Status Bar\"
click menu item \"Hide Tab Bar\"
click menu item \"Hide Toolbar\"
end tell
set bounds of window 1 to {0, 22, 1280, 800}
else
tell application \"System Events\" to click button 2 of window 1 of process \"Safari\" -- push the green button. It's a quick way to get a moderate size window.
-- opposite of above
tell application \"System Events\" to tell process \"Safari\" to tell menu bar 1 to tell menu bar item \"View\" to tell menu \"View\"
click menu item \"Show Bookmarks Bar\"
click menu item \"Show Status Bar\"
click menu item \"Show Tab Bar\"
click menu item \"Show Toolbar\"
end tell
end if
end tell
It looks like you're new here. If you want to get involved, click one of these buttons!