REFERENCES FOR LEARNING & USING APPLESCRIPT Modified: 2018/06/19 18:47
AppleScript is a rather peculiar scripting language to learn.
license: mit |
(* | |
This script is for anyone who still has the classic Mac OS era habit of using | |
Command-N to create a new folder in the Finder. It's intended for use with | |
Red Sweater Software's excellent FastScripts utility -- a replacement for the | |
system's build-in Scripts menu that allows for assigning keyboard shortcuts | |
to scripts, on a per-application basis. | |
FastScripts: https://red-sweater.com/fastscripts/ | |
Install the script here: ~/Library/Scripts/Applications/Finder/ |
#!/usr/bin/perl | |
# This filter changes all words to Title Caps, and attempts to be clever | |
# about *un*capitalizing small words like a/an/the in the input. | |
# | |
# The list of "small words" which are not capped comes from | |
# the New York Times Manual of Style, plus 'vs' and 'v'. | |
# | |
# 10 May 2008 | |
# Original version by John Gruber: |
$ spctl --verbose=4 --assess --type execute xScope.app | |
xScope.app: rejected | |
source=obsolete resource envelope | |
$ codesign --verify --verbose=4 xScope.app | |
--prepared:/Users/craig/Downloads/xScope.app/Contents/Frameworks/Sparkle.framework/Versions/Current/. | |
--validated:/Users/craig/Downloads/xScope.app/Contents/Frameworks/Sparkle.framework/Versions/Current/. | |
--prepared:/Users/craig/Downloads/xScope.app/Contents/Frameworks/YAML.framework/Versions/Current/. | |
--validated:/Users/craig/Downloads/xScope.app/Contents/Frameworks/YAML.framework/Versions/Current/. |
<!DOCTYPE html> | |
<head> | |
<title>El Capitan</title> | |
<style> | |
body { | |
font-size: 2em; | |
} | |
h1 { | |
font-family: "System Font Black", HelveticaNeue-CondensedBlack, ComicSansMS; |
set _old_delims to AppleScript's text item delimiters | |
set AppleScript's text item delimiters to {""} | |
tell application "System Events" | |
set _current_app to name of the first process whose frontmost is true | |
end tell | |
tell application "Safari" | |
set _urls to {} | |
repeat with i from 1 to 6 -- how many Safari windows to show URLs from |
Short version: I strongly do not recommend using any of these providers. You are, of course, free to use whatever you like. My TL;DR advice: Roll your own and use Algo or Streisand. For messaging & voice, use Signal. For increased anonymity, use Tor for desktop (though recognize that doing so may actually put you at greater risk), and Onion Browser for mobile.
This mini-rant came on the heels of an interesting twitter discussion: https://twitter.com/kennwhite/status/591074055018582016
function foo(x) { x = (typeof x != "undefined") ? x : 10; .. } | |
function foo(x = 10) { .. } | |
function foo(x,y,z) { .. }; foo.apply(null,[1,2,3]); | |
function foo(x,y,z) { .. }; foo(...[1,2,3]); | |
function foo() { var args = [].slice.call(arguments); .. } | |
function foo(...args) { .. } | |
var o = { x: 2, y: 3 }, x = o.x, y = o.y, z = (typeof o.z != "undefined") ? o.z : 10; |