Skip to content

Instantly share code, notes, and snippets.

View JMichaelTX's full-sized avatar

JMichaelTX JMichaelTX

View GitHub Profile
@JMichaelTX
JMichaelTX / Main.css
Last active August 29, 2017 08:25 — forked from chrisphenry/Main.css
Safari 7 & 9 - Customise Web Inspector font
/*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)
*/
@redsweater
redsweater / SwitchProfile
Created October 12, 2011 15:35
If you use ScanSnap, you can have GUI Scripting automate the process of switching among your scan profiles ...
-- 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()
@gildotdev
gildotdev / txt2rtf.sh
Created October 27, 2010 17:13
Simple Bash script to create a rich text format file from a plain text file
#!/bin/sh
#check to see if arguments are set
E_BADARGS=65
if [ ! -n "$1" ]
then
echo "Usage: `basename $0` textfilename [rtffilename optional]"
exit $E_BADARGS
fi
@RobTrew
RobTrew / JXA_UIToggle.applescript
Created February 24, 2015 13:06
OS X Yosemite Javascript for Applications (JXA): Toggling background, dark mode, and screen color inversion between day ⇄ night settings
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)
@RobTrew
RobTrew / expand_ft.applescript
Created November 18, 2012 18:57
Expand/Collapse FT to level N, or by N levels
-- Copyright (C) 2012 Robin Trew
--
-- Permission is hereby granted, free of charge,
-- to any person obtaining a copy of this software
-- and associated documentation files (the "Software"),
-- to deal in the Software without restriction,
-- including without limitation the rights to use, copy,
-- modify, merge, publish, distribute, sublicense,
-- and/or sell copies of the Software, and to permit persons
-- to whom the Software is furnished to do so,
@RobTrew
RobTrew / jxaClickAppSubMenuItem.applescript
Last active January 16, 2023 20:15
Yosemite JXA Javascript Function for clicking application sub-menu items
// Click an OS X app sub-menu item
// 2nd argument is an array of arbitrary length (exact menu item labels, giving full path)
// e.g. menuItemClick("InqScribe", ['View', 'Aspect Ratio', 'Use Media Ratio'])
// Note that the menu path (spelling & sequence) must be exactly as in the app
// See menuItemTestClick() below for a slower version which reports any errors
// For macOS Yosemite to Sierra
@RobTrew
RobTrew / tidyJSCode.applescript
Last active January 21, 2023 00:53
Use js-beautify to reformat code in OS X 10.10 (Yosemite) Script Editor
// 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';
@RobTrew
RobTrew / toggleComments.js
Last active January 21, 2023 00:53
Toggle selected comments in OS X 10.10 Script Editor
// ROBIN TREW 2015 MIT License
// OSX 10.10 SCRIPT EDITOR – TOGGLE COMMENTS
// Add remove '// ' from before printing characters
// Depends on a library .scpt being saved at ~/Library/Script Libraries/DraftsSE.scpt
// See: See: http://support.foldingtext.com/t/writing-scripts-which-run-on-both-foldingtext-and-ios-drafts-4/652/7
// INCLUDE LIBRARY OF IOS DRAFTS-COMPATIBLE EDITOR FUNCTIONS:
@RobTrew
RobTrew / indentLines.js
Last active January 21, 2023 00:54
Indent selected line(s) in OS X 10.10 Script Editor
// ROBIN TREW 2015 MIT License
// OSX 10.10 SCRIPT EDITOR – INDENT SELECTED LINES (with Tab or 4 spaces)
// Add remove '// ' from before printing characters
// Depends on a library .scpt being saved at ~/Library/Script Libraries/DraftsSE.scpt
// See: See: http://support.foldingtext.com/t/writing-scripts-which-run-on-both-foldingtext-and-ios-drafts-4/652/7
// INCLUDE ALL OR PART OF LIBRARY OF IOS DRAFTS-COMPATIBLE EDITOR FUNCTIONS: