Skip to content

Instantly share code, notes, and snippets.

@fuji246
Created March 19, 2020 18:54
Show Gist options
  • Save fuji246/61c1e03651958550b9da9754227f1def to your computer and use it in GitHub Desktop.
Save fuji246/61c1e03651958550b9da9754227f1def to your computer and use it in GitHub Desktop.
script to control camtwist
#!/usr/bin/osascript
on openCamTwist()
tell application "CamTwist"
activate
delay 1
end tell
end openCamTwist
on loadCamTwist()
tell application "CamTwist"
activate
loadSetup("test")
end tell
tell application "System Events" to set visible of process "CamTwist" to false
end loadCamTwist
on closeCamTwist()
tell application "CamTwist" to quit
delay 1
end closeCamTwist
on run argv
set helpStr to "Usage: camtwist.applescript[(open|load|close)]"
set action to "none"
if length of argv is not less than 1 then
set action to item 1 of argv
end if
if action is equal to "open" then
openCamTwist()
else if action is equal to "close" then
closeCamTwist()
else if action is equal to "load" then
loadCamTwist()
else
return helpStr
end if
end run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment