Skip to content

Instantly share code, notes, and snippets.

View judismith's full-sized avatar

Judi Smith judismith

  • PJS Engineering
  • Phoenix
View GitHub Profile
@judismith
judismith / Log tasks and hours to Day One
Created August 10, 2012 16:36
AppleScript to create Day One entry for hours logged in TaskPaper - Based on the AppleScript from Brett Terpstra to log TaskPaper completed tasks to Day One. This script does both
set archivedTasks to ""
set hoursEntries to ""
tell application "TaskPaper"
tell front document
-- don't care which file your log entry came from?
-- comment the next line out
set archivedTasks to "## " & name & return
set hoursEntries to "## " & name & ": Hours" & return
repeat with _task in search with query "project != Archive and @done"
if entry type of _task is not project type then
@judismith
judismith / FM Applescript Ping
Created August 11, 2012 04:22
Test for internet connection within Filemaker
try
set thePing to do shell script "/sbin/ping -o -c 5 www.google.com"
on error
set thePing to "error"
end try
tell application "FileMaker Pro Advanced"
if thePing is not "error" then
set cell "g_internet" to "true"
else
@judismith
judismith / BCX_API_upload.rb
Created August 21, 2012 03:00
Ruby script to create projects through the Basecamp Next API from file
require 'net/https'
require 'uri'
require 'rubygems'
require 'json/pure'
# replace 9999999 with your instance id
@path = '/9999999/api/v1/projects.json'
@user = 'username'
@pass = 'password'
@judismith
judismith / BCX_API_Get_Projects.rb
Created August 21, 2012 03:02
Ruby script to get all projects from Basecamp Next API to file
require 'net/https'
require 'uri'
# replace 9999999 with your instance id
@path = '/9999999/api/v1/projects.json'
@user = 'username'
@pass = 'password'
uri = URI.parse('https://basecamp.com')
http = Net::HTTP.new(uri.host, uri.port)
@judismith
judismith / BCX_API_Delete_Proj.rb
Created August 21, 2012 03:07
Delete projects through Basecamp Next API from list in file
require 'net/https'
require 'uri'
require 'rubygems'
require 'json/pure'
@user = 'username'
@pass = 'password'
file = File.new("bc_proj.txt", "r")
@judismith
judismith / Toggl_API_Get_Clients.rb
Created August 21, 2012 03:10
Ruby script to list of clients from Toggl through API
require 'net/https'
require 'uri'
@path = '/api/v6/clients.json'
# insert API token in the user variable
@user = ''
@pass = 'api_token'
uri = URI.parse('https://www.toggl.com')
@judismith
judismith / Evernote to Marked.applescript
Last active December 18, 2015 07:29
Grab the contents of an Evernote note, run it through the shell to clean it up a bit, then send it on to Marky to get markdownified. Finally we write it to the base folder of Google Drive. The idea is to take notes on the go in EN, then upload them to Drive to share with the whole team.
tell application "Evernote"
if (not (tag named "exported" exists)) then
make tag with properties {name:"exported"}
end if
set matches to find notes "tag:etf"
repeat with theNote in matches
set myTitle to title of theNote
set myTags to tags of theNote
set tagList to ""
repeat with theTag in myTags
@judismith
judismith / Folder List to Evernote.applescript
Created June 10, 2013 05:37
Gets the names of folders two levels deep. Puts the names in a list with the subfolders indented. I use this to keep a handy list of all of my clients and their matter numbers. I use the names and numbers in the titles of notes pertaining to the client. When I export the EN Notes with the Evernote to Marked script, the Hazel rule watching the ex…
tell application "Finder"
set folderList to ""
set mattersFolder to (((path to home folder as text) & "Google Drive:Matters:"))
set clientFolders to get name of folders of folder mattersFolder
repeat with theFolder in clientFolders
set folderList to folderList & theFolder & return
set thePath to mattersFolder & theFolder
set subFolders to get the name of folders of folder thePath
if (count of subFolders) is greater than 0 then
repeat with aFolder in subFolders
@judismith
judismith / Prepend and Move.applescript
Created June 11, 2013 19:44
This script prepends the parent folder name and " - " to all the children folders. It them moves the children folders to the same level as the parent folder.
tell application "Finder"
set thePath to (path to desktop folder as text)
set clientFolders to get name of folders of folder thePath
repeat with theFolder in clientFolders
if the theFolder starts with "_" then exit repeat
set matterFolders to get folders of folder (thePath & theFolder as text)
repeat with aFolder in matterFolders
set clientName to theFolder as text
set the name of aFolder to theFolder & " - " & the name of aFolder
end repeat
@judismith
judismith / New project from folder.applescript
Last active June 12, 2019 10:50
Script for use with Hazel to create a new project in OmniFocus when a new folder is created in the top level project folder. Apparently Hazel doesn't like it when you tinker with the variable "theFile" within the script. Also it seems that Hazel doesn't allow functions in the internal applescripts.
tell application "Finder"
-- set theFile to "Macintosh HD:Users:[username]:Google Drive:Matters:Test Folder:" -- For testing
set myFile to do shell script "basename " & (the quoted form of (the POSIX path of theFile))
-- check to see if it is worth starting OF
if myFile does not start with "_" and (theFile as string) ends with ":" then
set theDueDate to (current date) + 7 * days