Skip to content

Instantly share code, notes, and snippets.

View cbuck's full-sized avatar

Chris Buckland cbuck

View GitHub Profile
@cbuck
cbuck / SSID_automount.applescript
Last active October 5, 2015 01:07
Automount network drives via ssid name
set SSID to do shell script "/System/Library/PrivateFrameworks/Apple80211.framework/Resources/airport -I | awk '/ SSID: / {print $2}'"
if SSID is "officenetwork" then
tell application "Finder"
try
mount volume "afp://server.local/share1"
mount volume "afp://anotherserver.local/share2"
end try
end tell
set endresult to "Office"
@cbuck
cbuck / AVTime NTP.ini
Last active October 5, 2015 15:38
AVTime master NTP
[AvTime]
Protected=FALSE
Lana=0
ShutDownDialog=False
Mode=Master
SyncedState=Hide
UnsyncedState=Hide
WindowState=1
ReferenceName=nist.gov
ReferenceSource=NTP
@cbuck
cbuck / Growl.applescript
Created June 13, 2012 14:59 — forked from mceachen/Growl.applescript
iChat and Messages applescript integration: place in ~/Library/Scripts/Messages
using terms from application "iChat"
on message received message from theBuddy for textChat
set whoDidIt to full name of theBuddy
set who to "iChat: " & whoDidIt
set buddyIcon to image of theBuddy
tell application "System Events"
set frontApp to name of first application process whose frontmost is true
end tell
tell application frontApp
set window_name to name of front window
tell front window of application "Safari"
make new tab with properties {URL:"http://poseidon"}
end tell
tell application "Google Chrome"
try
if (count of (every window where visible is true)) is greater than 0 then
tell front window
make new tab
end tell
@cbuck
cbuck / rdio_song.applescript
Last active October 7, 2015 04:28
Get current song from Rdio app
on ApplicationIsRunning(appName)
tell application "System Events" to set appNameIsRunning to (name of processes) contains "Rdio"
return appNameIsRunning
end ApplicationIsRunning
on np()
if ApplicationIsRunning("Rdio") then
tell application "Rdio"
set track_name to get name of current track
set artist_name to get artist of current track
@cbuck
cbuck / rdio_artist.applescript
Last active October 7, 2015 04:28
Get current artist from Rdio app
on ApplicationIsRunning(appName)
tell application "System Events" to set appNameIsRunning to (name of processes) contains "Rdio"
return appNameIsRunning
end ApplicationIsRunning
on np()
if ApplicationIsRunning("Rdio") then
tell application "Rdio"
set artist_name to get artist of current track
end tell
@cbuck
cbuck / rdio_artwork.applescript
Last active October 7, 2015 04:37
get current album art from playing track from Rdio app.
set RdioArtworkFolder to ((path to home folder) as text) & "Pictures:Rdio:" as alias
set ArtworkFromRdio to ((path to home folder) as text) & "Pictures:Rdio:FromRdio:albumArt.tiff" as alias
set RdioArtwork to ((path to home folder) as text) & "Pictures:Rdio Artwork:FromRdio:albumArt.tiff"
set RdioBackground to ((path to home folder) as text) & "Pictures:Rdio Artwork:FromRdio:black_background.png"
set DefaultArtwork to ((path to home folder) as text) & "Pictures:RdioArtwork:Default:albumArt.tiff"
set DefaultBackground to ((path to home folder) as text) & "Pictures:Rdio:Default:transparent_background.png"
set displayArtwork to ((path to home folder) as text) & "Pictures:Rdio:albumArt.tiff"
set displayBackground to ((path to home folder) as text) & "Pictures:Rdio:background.png"
set FromRdioFolder to ((path to home folder) as text) & "Pictures:Rdio:FromRdio:"
set ArtworkFromRdio to FromRdioFolder & "albumArt.tiff" as alias
@cbuck
cbuck / buddies.applescript
Last active November 29, 2016 07:54
Get buddies list from MESSAGES app
set newline to ASCII character 10
set availableFormat to "\\033[0;37m"
set awayFormat to "\\033[0;30m"
set idleFormat to "\\033[0;30m"
set offlineFormat to "\\033[0;30m"
set unknownFormat to "\\033[0;30m"
set resetFormat to "\\033[0;30m"
set ownName to "****YOURNAME****"
@cbuck
cbuck / success.bat
Created September 30, 2015 12:59
Parse the converter logs for successfull conversions and then save to a new text file for processing
type converter.log | findstr successful>success.csv
@cbuck
cbuck / nexgen_multi.bat
Created September 30, 2015 13:00
FIND MULTI CUTS IN NEXGEN AUDIO DIRECTORY... Fun with REGEX
CD F:\ENTWIC\RENM\COM
Dir /B>f:\ENTWIC\Dir.txt
FindStr /R [0-9]*[2-9].[Ww][Aa][Vv] f:\ENTWIC\Dir.txt>f:\ENTWIC\multicuts.txt