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
| -- Launches ScanSnap Manager, if necessary. Opens the ScanSnap Manager settings window, | |
| -- changes to named profile, applies changes, and closes the window | |
| -- Example: | |
| SwitchToProfile("Standard") | |
| on SaveActiveApplication() | |
| return application | |
| end SaveActiveApplication | |
| on OpenOptionsWindow() |
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
| -- This script includes examples for using AppleScript to perform several | |
| -- useful tasks with Evernote. | |
| -- Each section illustrates a chunk of Evernote's AppleScript interface, | |
| -- and each section also cleans up after itself. | |
| -- Please refer to the Evernote application's scripting dictionary for |
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
| if (typeof exports === 'undefined') exports = {} | |
| function timer (repeats, func, delay) { | |
| var args = Array.prototype.slice.call(arguments, 2, -1) | |
| args.unshift(this) | |
| var boundFunc = func.bind.apply(func, args) | |
| var operation = $.NSBlockOperation.blockOperationWithBlock(boundFunc) | |
| var timer = $.NSTimer.timerWithTimeIntervalTargetSelectorUserInfoRepeats( | |
| delay / 1000, operation, 'main', null, repeats | |
| ) |
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
| /*Customise Safari Web Inspector font*/ | |
| /*(tested on Safari 7.0.1 on OS X Mavericks)*/ | |
| /* Tested on Safari 9.1 (11601.5.17.1) on OSX 10.11.4 as of 2016-05-08 */ | |
| /* | |
| JMichaelTX NOTE: | |
| - This process was written for Safari 7 (Mavericks) | |
| - I found it worked fine with Safari 9.1 (11601.5.17.1) on OSX 10.11.4, with just a few simple changes (noted below) | |
| */ |
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
| (function () { | |
| 'use strict'; | |
| // OSX JavaScript for Applications lacks the persistent 'properties' | |
| // of AppleScript (in which global variables and properties persist between script runs) | |
| // but we can, of course, serialise to JSON or plist at the end of a script | |
| // parsing it at the start of the next run. | |
| // Here is one approach to persistence between script runs | |
| // using JSON.stringify() and JSON.parse() |
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 strJS to " | |
| var xpathResults = document.evaluate('//*[@class=\\'r\\']/a', document, null, 0, null), | |
| lst = [], | |
| oNode; | |
| while (oNode = xpathResults.iterateNext()) { | |
| lst.push([ | |
| '[', | |
| oNode.text, | |
| '](', |
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
| // YOSEMITE Javascript for Applications JXA | |
| // Capture the main result links from a Google search page as Markdown | |
| // ( Using XPath to search for <a> elements which are children | |
| // of elements with class 'r' | |
| var resultLinksMD = function () { | |
| var r = document.evaluate( | |
| "//*[@class='r']/a", | |
| document, null, 0, null | |
| ), |
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
| function run() { | |
| // Rob Trew 2015 | |
| // Ver 0.01 | |
| // UI day/night toggling through OS X 10.10 JXA Javascript for Automation | |
| // SWITCH FROM DAY-TIME DARK MENU BAR AND DOCK WITH DARK BACKGROUND | |
| // TO NIGHT-TIME *ALL DARK* | |
| // (TOGGLE MODE AND BACKGROUND TO BRIGHT, THEN INVERT ALL) |
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
| function run() { | |
| // KEYBOARD MAESTRO VARIABLES IN YOSEMITE JXA JAVASCRIPT FOR APPLICATIONS | |
| // FINDING, CREATING, READING, UPDATING | |
| // SIMPLE EXAMPLE - TOGGLING A BOOLEAN KM VARIABLE FROM .js | |
| var strKMVarName = "flag"; | |
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
| // Ver 0.2 | |
| // Restores syntax highlighting by recompiling | |
| // either restoring cursor or placing it at first error found | |
| // Assumes installation of node.js | |
| // http://nodejs.org/download/ | |
| // with npm at: | |
| var pathNPM = '/usr/local/bin'; |
OlderNewer