Skip to content

Instantly share code, notes, and snippets.

@rjocoleman rjocoleman/gist:8312639

Last active Jan 2, 2016
What would you like to do?
AppleScript to open Steam in 'big picture' mode. If steam is already running it convert to 'big picture' mode. If a steam game is running in the foreground then nothing should happen. Relies on `pgrep` which comes along with 10.8+.
on isRunningAndSteam(theProcess)
set result to do shell script "
if grep -q \"\\-steam\" <<< `/bin/ps -xo command -p \"\\`/usr/bin/pgrep " & theProcess & "\\`\"`; then
echo true
echo false
return result as boolean
end try
end isRunningAndSteam
-- e.g. isRunningAndSteam("hl2_osx")
tell application "System Events"
set currentApp to name of application processes whose frontmost is true
end tell
if not isRunningAndSteam(currentApp) then
do shell script "open /Applications/ --args -start steam://open/bigpicture"
end if

This comment has been minimized.

Copy link

ghost commented Nov 13, 2015

Hi rjocoleman, I have a question
Is there a event on the steam process when you close big picture mode?

I'm looking for a way to manage the big picture status and running scripts on open and close events.

Well I am looking forward to your reply, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.