Skip to content

Instantly share code, notes, and snippets.

View prenagha's full-sized avatar

Padraic Renaghan prenagha

View GitHub Profile
@prenagha
prenagha / ArqMonitor.scpt
Last active December 3, 2024 10:51
Applescript to monitor age of last arq backupand send alert to notification center and email if too oldHook it up to run via launchd daily
--
-- Applescript to monitor age of last arq backup
-- and send alert to notification center if too old
--
set arqF to (path to current user folder) & "Library:Arq:lastsV2.dat" as string
set latest to arqF as alias
set mod_date to modification date of (info for latest)
set file_age to round (((current date) - mod_date) / days)
log "most recent Arq backup " & file_age & " days old " & arqF
@prenagha
prenagha / TimeMachineMonitor.scpt
Last active December 8, 2023 23:16
Applescript to monitor age of last time machine backup and send alert to notification center and email if too old Set it up in launchd to run daily
--
-- Applescript to monitor age of last time machine backup
-- and send alert to notification center if too old
--
set tmLatest to do shell script "/usr/bin/tmutil latestbackup"
set latest to POSIX file tmLatest
set mod_date to modification date of (info for latest)
set file_age to round (((current date) - mod_date) / days)
log "most recent TM backup " & file_age & " days old"
@prenagha
prenagha / Run in Terminal.scpt
Last active May 27, 2018 00:39
run terminal command and return results directly back to launchbar
--
-- run terminal command and return results directly back to launchbar
-- runs command using applescript which means under /bin/sh
-- switches to user home dir before running script
--
-- take string from LaunchBar and run as command
on handle_string(theText)
try
set cmd to "cd ~ && " & theText
@prenagha
prenagha / Create Gist.scpt
Created January 13, 2014 15:17
Launchbar action to create public gist
--
-- gist support for launchbar
-- 1. install gist client "sudo gem install gist"
-- https://github.com/defunkt/gist
-- 2. login "gist --login"
--
-- use from launchbar as file action, string/search action, or
-- plain action (will take text from clipboard)
-- then will put gist url as launchbar result
-- from there you can Copy it or hit Enter to open in browser
@prenagha
prenagha / Copy to iPhone.scpt
Last active January 5, 2025 00:39
Launchbar integration applescript for command-c http://danilo.to/command-c/
--
-- Source: Padraic Renaghan [email protected] https://gist.github.com/prenagha/8372844
--
-- launchbar integration applescript for command-c
-- http://danilo.to/command-c/
--
-- set the variable "theDevice" below as needed to the device name you want to send to
-- Put script in Launchbar actions folder
-- ~/Library/Application Support/Launchbar/Actions
--
@prenagha
prenagha / Chat.applescript
Created January 7, 2014 01:58
Launchbar script to allow you to send an Adium chat message directly from within Launchbar Install: put this script in ~/Library/Application Support/Adium/Actions Invoke Launchbar type "Chat" to find this action, then space to trigger text entry, then "<contact partial name><space>chat message"
-- used via launchbar
-- im_text: contact_partial_name message
handle_string("foobar testing")
on handle_string(im_text)
-- start adium if its not running
if application "Adium" is not running then
tell application "Adium" to activate
-- wait a few seconds to let the accounts login
@prenagha
prenagha / fake workflow.txt
Last active December 15, 2015 03:58
Google Voice Delete All History
Google Voice provides no easy way to clear your history.
Here is how I did it.
1) Get the Fake app http://fakeapp.com
It lets you write scripts to automate Safari
2) Create a workflow in Fake that has the following steps
Load URL, https://www.google.com/voice/#history
Assert Condition, page title equals : Google Voice - History
@prenagha
prenagha / fluid-inotes.css
Created January 14, 2013 17:35
CSS to use as a Userstyles file within a custom Fluid app wrapper for Lotus Notes iNotes. Will show overlay please wait after login. http://fluidapp.com see also https://gist.github.com/4531725
/* Start by setting display:none to make this hidden.
Then we position it in relation to the viewport window
with position:fixed. Width, height, top and left speak
speak for themselves. Background we set to 80% white with
our animation centered, and no-repeating */
div.loading {
display: block;
position: fixed;
z-index: 1000;
@prenagha
prenagha / fluid-inotes.js
Created January 14, 2013 17:30
Javascript to use as a Userscript file within a custom Fluid app wrapper for Lotus Notes iNotes # Will update the app's doc badge with the current unread count # Will trigger alert sound and send a growl notification when new mail arrives http://fluidapp.com See also https://gist.github.com/4531763
// put this file somewhere on your Mac
// download jquery and put it there as well
// then in Fluid, under the Userscripts option set the path pattern to match your
// inotes UL, then add the below, tweak for your path
// window.fluid.include("/Users/userid/Documents/Mac/Fluid/jquery-1.8.3.min.js");
// window.fluid.include("/Users/userid/Documents/Mac/Fluid/fluid-inotes.js");
//
// Note the auto userid and password filling this script does. Obviously adjust to
// your info. Line ~108 below.
@prenagha
prenagha / VPN Toggle.scpt
Created November 5, 2012 15:16
VPN toggle applescript for launchbar
--
-- applescript to toggle connection state of vpn
-- http://markupboy.com/blog/view/toggling-vpn-with-applescript
-- http://www.plankdesign.com/blog/2012/06/toggle-your-network-settings-with-launchbar/
--
tell application "System Events"
tell current location of network preferences
-- set this to the name of your VPN config
set VPNservice to service "vpn service name"
set isConnected to connected of current configuration of VPNservice