Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

i need an applescript to open safari in full screen an to hide the toolbar on mavericks

I need an applescript to open safari in full screen an to hide the toolbar on mavericks.

it sounds easy but it isnt!

i need to open safari then open google in full screen mode an then hide the toolbar.

it would be the equivilent to the below sample but instead for safari

tell application "Google Chrome" open location "http://internet.ceo.wa.edu.au/Pages/default.aspx" end tell

tell application "Google Chrome" to activate tell application "System Events" keystroke "f" using {command down, shift down} end tell

like image 584
Michael Sanders Avatar asked Apr 02 '14 04:04

Michael Sanders


2 Answers

Could be simple as this:

tell application "Safari"
    activate

    if (count of windows) is 0 then -- Remove "if" statement if you don't want to make a new window if there is none
        make new document at front
    end if
    tell application "System Events" to keystroke "f" using {command down, control down}
end tell

Not sure if you can make it with no toolbar at all.

Update 4/4

not sure what you can do with it but look into this program. If it works the way you want. Add a system events to use the drop downs to select the item.

The Barbarian Group has a freeware app called "Plainview", which seems to be just a wrapper around Webkit. It works as a "Fullscreen kiosk-style presentation content viewer", similar to what Chrome presentation mode does.

Anyways, it's a free download, so no risk in trying. Scroll almost to the bottom of this page: http://barbariangroup.com

Direct download: http://s3.amazonaws.com/plainviewapp/plainview_1.0.178.zip

like image 167
Tim Joe Avatar answered Sep 21 '22 19:09

Tim Joe


Easy way:

set MyApps to {"Google Chrome", "Skype", "Finder"}

repeat with MyApp in MyApps

    tell application MyApp

        activate

        delay 3

        tell application "System Events" to tell process MyApp

            set value of attribute "AXFullScreen" of window 1 to true

        end tell

    end tell

end repeat
like image 24
DenniOnLine Avatar answered Sep 22 '22 19:09

DenniOnLine