1

I am trying to make a bash script to open up my working environment. I want

1) Open up Terminal.app and type a command like "time_to_work" 2) This command will:

a. open up sublime text

open ~/Documents/Programming/ -a Sublime\ Text.app

b. make the current terminal window full screen

c. Open up google chrome

I am getting stuck on 2.b. Is there a simple command, or would I have to do something like find the process ID and send it a signal (if that even makes sense)?

I would also be able to work with a command that will open up a new window in full screen mode.

Thanks!

  • What terminal application do you use? – choroba Jan 28 '15 at 18:09
  • The default one that comes pre-installed. Version 2.4 – Seth Jan 28 '15 at 18:16
  • That's not Unix, that's Mac OS X (which technically is Unix-certified, but you couldn't achieve what you want using the Unix subset of OS X) – slhck Jan 28 '15 at 18:20
0

Simply use AppleScript commands:

osascript <<"EOF"
    tell application "Terminal" to activate
    tell application "System Events" to keystroke "f" using { command down, control down }
    delay 3
    tell application "Google Chrome" to activate
EOF

The delay is necessary in order to have Terminal complete the fullscreen action.

0

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

repeat with MyApp in MyApps

tell application MyApp

    activate

    delay 3

end tell

tell application "System Events"

    tell process MyApp

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

        delay 3

    end tell

end tell

end repeat

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.