2

I would like to know how you would be able to open a app of your choice in fullscreen by using bash code in terminal.

3

Here's the AppleScript you can use to launch the app and then go to fullscreen mode.

on run argv
    if (count of argv) > 0 then
        set result to item 1 of argv
    else
        set result to text returned of (display dialog "Enter the name of the app to launch" default answer "")
    end if

    set appName to result

    tell application appName
        activate
        delay 3

        tell application "System Events" to tell process appName
            set value of attribute "AXFullScreen" of window 1 to true
        end tell

    end tell
end run

Paste that to Script Editor.app, save it as a script (run only). Give osascript access to accessibility functions in Preferences->Privacy->Accessibility (click + and locate /usr/bin/osascript).

With that you can run something like osascript fullscreen.scpt Photos.

0

you can open an app by using the command open via the terminal, though I don't think you can tell the app to be full screen.

so you could do something like:

open /Applications/Safari.app

Unfortunately I can't see a way from the terminal to open full screen, though the other way you could do it is via apple script.

  • Hint: You can use osascript to run some AppleScript afterwards to send a fullscreen command to the application :-) – nohillside Feb 2 at 8:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .