Skip to content

Instantly share code, notes, and snippets.

View robotsandcake's full-sized avatar
💭
Groovy

Stuart robotsandcake

💭
Groovy
View GitHub Profile
@robotsandcake
robotsandcake / lifx_blue_flash_all.applescript
Created August 15, 2017 09:48
When run, this small piece of AppleScript will flash every LIFX lightbulb in the house blue as part of an IF recipe.
-- This sends an event to the Maker IFTTT channel, replace blue_flash_all with
-- whatever you like but make sure that URL is saying wherever you use it.
set theURL to "https://maker.ifttt.com/trigger/blue_flash_all/with/key/YOUR_SECRET_KEY"
do shell script "curl " & quoted form of theURL
@robotsandcake
robotsandcake / popclip-overlay.applescript
Created May 14, 2017 11:40
This AppleScript when coupled with DragonDictate for Mac will open up the PopClip overlaid on any selected text
-- Open up the PopClip overlay on any selected text
tell application "PopClip" to appear
@robotsandcake
robotsandcake / screen-sharing.applescript
Created May 14, 2017 11:27
This AppleScript when coupled with DragonDictate for Mac enables you to share the screen of a computer you own.
-- Bring Screen Sharing.app to the front and start VNC session
tell application "Screen Sharing"
activate
GetURL "vnc://[email protected]"
end tell
@robotsandcake
robotsandcake / growl-time.applescript
Created May 14, 2017 10:43
This AppleScript when combined with Growl and DragonDictate for Mac will display the current date and time
set the date_stamp to ((the current date) as string)
tell application "Growl"
-- Make a list of all the notification types
set the allNotificationsList to ¬
{"Date and Time"}
--Default enable notifications
set the enabledNotificationsList to ¬
{"Date and Time"}
--register with growl
register as application ¬
@robotsandcake
robotsandcake / toggle-quicktime.applescript
Created May 14, 2017 10:32
This AppleScript when combined with DragonDictate for Mac will play/pause QuickTime player each time it is issued
tell application "QuickTime Player"
if document 1 is playing then
pause document 1
else
play document 1
end if
end tell
@robotsandcake
robotsandcake / previous-itunes.applescript
Created May 14, 2017 10:08
This AppleScript when used in conjunction with DragonDictate for Mac will skip to the previous track in iTunes
try
tell application "iTunes"
previous track
-- user probably expects to hear something so if we are not playing, make it play
if player state is not playing then
play
end if
end tell
on error -- if there is an error then beep
beep
@robotsandcake
robotsandcake / itunes-next.applescript
Created May 14, 2017 10:06
This AppleScript when used in conjunction with DragonDictate for Mac skips to the next track in iTunes
try
tell application "iTunes"
next track
-- user probably expects to hear something so if we are not playing, make it play
if player state is not playing then
play
end if
end tell
on error -- if there is an error then beep
beep
@robotsandcake
robotsandcake / itunes-information.applescript
Created May 14, 2017 10:02
In conjunction with the application Growl, this AppleScript will show information about the currently playing track in iTunes.
set crlf to (ASCII character 13) & (ASCII character 10)
set escapeChar to ASCII character (9)
tell application "Growl"
-- Make a list of all the notification types
-- that this script will ever send:
set the allNotificationsList to {"iTunes Playing Track"}
-- Make a list of the notifications
-- that will be enabled by default.
-- Those not enabled by default can be enabled later
@robotsandcake
robotsandcake / itunes-play-pause.applescript
Created May 14, 2017 10:01
This AppleScript when used in conjunction with DragonDictate for Mac will play/pause the current iTunes track.
try
-- Specify the application will want to work on, in this case iTunes.
tell application "iTunes"
-- Get iTunes current state
if player state is paused then
-- If iTunes is paused, press play.
play
-- Get iTunes state if it doesn't match the first condition
else if player state is playing then
-- If iTunes is playing, press pause.
@robotsandcake
robotsandcake / play-pause-itunes.scpt
Last active April 4, 2017 10:05
This AppleScript will toggle the iTunes player on macOS between two states, play and pause. It can be triggered from any application that can trigger AppleScripts.
try
-- Specify the application will want to work on, in this case iTunes.
tell application "iTunes"
-- Get iTunes current state
if player state is paused then
-- If iTunes is paused, press play.
play
-- Get iTunes state if it doesn't match the first condition
else if player state is playing then
-- If iTunes is playing, press pause.