Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@dannydb
Created September 5, 2014 13:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dannydb/ce41f15969394f9737ac to your computer and use it in GitHub Desktop.
Save dannydb/ce41f15969394f9737ac to your computer and use it in GitHub Desktop.
powermate scripts
tell application "System Events"
set frontmostProcess to name of first item of (processes whose frontmost is true)
tell process frontmostProcess
tell window 1
set oldSize to get size
-- change + to - for shrinking
-- change 100 to 5 for fine-tune mode
set newWidth to (item 1 of oldSize) - 5
set size to {newWidth, item 2 of oldSize}
end tell
end tell
end tell
tell application "System Events"
set frontmostProcess to name of first item of (processes whose frontmost is true)
tell process frontmostProcess
tell window 1
set oldSize to get size
-- change + to - for shrinking
-- change 100 to 5 for fine-tune mode
set newWidth to (item 1 of oldSize) + 5
set size to {newWidth, item 2 of oldSize}
end tell
end tell
end tell
tell the application "Finder" to sleep
tell application "Alfred 2" to run trigger "screensaver" in workflow "com.dannydebelius.screensaverpause" with argument "test"
tell application "System Events"
set frontmostProcess to name of first item of (processes whose frontmost is true)
tell process frontmostProcess
tell window 1
set oldSize to get size
-- change + to - for shrinking
-- change 100 to 5 for fine-tune mode
set newWidth to (item 1 of oldSize) - 50
set size to {newWidth, item 2 of oldSize}
end tell
end tell
end tell
tell application "System Events"
set frontmostProcess to name of first item of (processes whose frontmost is true)
tell process frontmostProcess
tell window 1
set oldSize to get size
-- change + to - for shrinking
-- change 100 to 5 for fine-tune mode
set newWidth to (item 1 of oldSize) + 50
set size to {newWidth, item 2 of oldSize}
end tell
end tell
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment