This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on open theFiles | |
repeat with aFile in theFiles | |
set appPath to POSIX path of aFile | |
set codeSignInformation to do shell script "codesign -vd '" & appPath & "' 2>&1" | |
display dialog codeSignInformation with title ("codesign -vd " & appPath) buttons {"Ok"} default button 1 | |
end repeat | |
end open | |
on run | |
open (choose file with multiple selections allowed) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on run | |
tell application "Finder" | |
activate | |
try | |
set this_folder to (the target of the front window) as alias | |
on error | |
set this_folder to startup disk | |
end try | |
my open_terminal_window(this_folder) | |
end tell |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var app = Application.currentApplication() | |
app.includeStandardAdditions = true | |
var itunes = Application("iTunes") | |
var url = "http://localhost:9200/itunes/track/" | |
var lib = itunes.sources["Library"] | |
var tracks = lib.tracks() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Safari = Application ("Safari") | |
if (Safari.documents().length > 0) { | |
var source = Safari.documents()[0].source() | |
Application("BBEdit").Document({"contents":source, "source language":"HTML"}).make() | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set progress total steps to 100 | |
repeat with i from 1 to 100 | |
set progress description to "Item " & i & " of " & 100 | |
set progress additional description to "foobar" | |
delay 1 | |
set progress completed steps to i | |
end repeat |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Progress.totalUnitCount = 100 | |
Progress.completedUnitCount = 0 | |
Progress.description = "Testing progress" | |
Progress.additionalDescription = "foobar" | |
for(i = 0; i < Progress.totalUnitCount; i++) { | |
Progress.description = "Item " + i + " of " + Progress.totalUnitCount | |
delay(1) | |
Progress.completedUnitCount = i | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'uri' | |
# without force_encoding ruby will throw an | |
# "invalid byte sequence in US-ASCII" exception | |
# when running this script from Automator | |
input = ARGF.read.force_encoding("UTF-8") | |
# scan for JIRA Ticket IDs like MYPROJECT-42 | |
input.scan(/([A-Z]+\-[0-9]+)/).each do |id| | |
url = "https://<your JIRA server>/browse/#{id[0]}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/sbin/dtrace -s | |
#pragma D option quiet | |
pid$target:mysqld:*mysql_parse*:entry | |
{ | |
printf("[%Y] %s\n", walltimestamp, copyinstr(arg1)); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
if let bundleURL = NSBundle.mainBundle().URLForResource("Settings", withExtension: "bundle") { | |
NSUserDefaults.registerDefaults(settingsBundleURL: bundleURL) | |
} | |
extension NSUserDefaults { | |
static func registerDefaults(#settingsBundleURL: NSURL) { | |
if let rootDict = NSDictionary(contentsOfURL: settingsBundleURL.URLByAppendingPathComponent("Root.plist")) { | |
var defaults: NSUserDefaults? |