text
stringlengths 0
15.7k
| source
stringlengths 6
112
|
---|---|
if bookmark_url is not "" then | Write Selected Bookmarks to Clipboard.applescript |
set content_string to content_string & bookmark_url & return | Write Selected Bookmarks to Clipboard.applescript |
set bookmark_desc to desc of current_bookmark | Write Selected Bookmarks to Clipboard.applescript |
if bookmark_desc is not "" then | Write Selected Bookmarks to Clipboard.applescript |
set content_string to content_string & bookmark_desc & return | Write Selected Bookmarks to Clipboard.applescript |
set content_string to content_string & return | Write Selected Bookmarks to Clipboard.applescript |
set the clipboard to content_string | Write Selected Bookmarks to Clipboard.applescript |
do() | Archive File.applescript |
on error errMsg number errNum | Archive File.applescript |
if errNum is not equal to -128 then | Archive File.applescript |
activate -- This prevents a beep when scripts are run from LaunchBar but it also makes the script run slower from the Script Menu | Archive File.applescript |
display dialog "AppleScript encountered an error." & ¬ | Archive File.applescript |
" Error Message: " & errMsg & " Number " & errNum | Archive File.applescript |
on do() | Archive File.applescript |
tell application "iA Writer" | Archive File.applescript |
set theFile to file of document 1 | Archive File.applescript |
set theUnixPath to POSIX path of theFile | Archive File.applescript |
set theResult to do shell script "~/.bin/backup_file " & the quoted form of the theUnixPath | Archive File.applescript |
display notification theResult with title "Archive File" | Archive File.applescript |
end do | Archive File.applescript |
set desiredPosition to {0.5, 0.5} | 28 - ↘️ … Bottom Right.scpt |
set desiredSize to {0.5, 0.5} | 28 - ↘️ … Bottom Right.scpt |
tell application "System Events" to tell process "Dock" | 28 - ↘️ … Bottom Right.scpt |
set dockDimensions to size in list 1 | 28 - ↘️ … Bottom Right.scpt |
set dockHeight to item 2 of dockDimensions | 28 - ↘️ … Bottom Right.scpt |
set finalPositionY to (item 2 of desiredPosition) * (screenHeight - dockHeight) + 8 | 28 - ↘️ … Bottom Right.scpt |
set finalSizeY to (item 2 of desiredSize) * (screenHeight - dockHeight - 32) | 28 - ↘️ … Bottom Right.scpt |
set badStuff to {"{", "#", "~", "a", "b", "str*", "gensym", "gensym_counter", "truth_", "type_satisfies_", "fixture1", "fixture2", "~(with-meta", "~psym", "#^:private", "~'apply-to"} as text | cljs-generator.applescript |
set jsReserved to {"^:abstract ", "^:boolean ", "^:break ", "^:byte ", "^:case ", "^:catch ", "^:char ", "^:class ", "^:const ", "^:continue ", "^:debugger ", "^:default ", "^:delete ", "^:do ", "^:double ", "^:else ", "^:enum ", "^:export ", "^:extends ", "^:final ", "^:finally ", "^:float ", "^:for ", "^:function ", "^:goto ", "^:if ", "^:implements ", "^:import ", "^:in ", "^:instanceof ", "^:int ", "^:interface ", "^:let ", "^:long ", "^:native ", "^:new ", "^:package ", "^:private ", "^:protected ", "^:public ", "^:return ", "^:short ", "^:static ", "^:super ", "^:switch ", "^:synchronized ", "^:this ", "^:throw ", "^:throws ", "^:transient ", "^:try ", "^:typeof ", "^:var ", "^:void ", "^:volatile ", "^:while ", "^:with ", "^:yield ", "^:methods "} as text | cljs-generator.applescript |
set excludes to {"-> ", "->> ", ".. ", "amap ", "and ", "areduce ", "alength ", "aclone ", "assert ", "binding ", "bound-fn ", "case ", "comment ", "cond ", "condp ", "declare ", "definline ", "definterface ", "defmethod ", "defmulti ", "defn ", "defn- ", "defonce ", "defprotocol ", "defrecord ", "defstruct ", "deftype ", "delay ", "destructure ", "doseq ", "dosync ", "dotimes ", "doto ", "extend-protocol ", "extend-type ", "fn ", "for ", "future ", "gen-class ", "gen-interface ", "if-let ", "if-not ", "import ", "io! ", "lazy-cat ", "lazy-seq ", "let ", "letfn ", "locking ", "loop ", "memfn ", "ns ", "or ", "proxy ", "proxy-super ", "pvalues ", "refer-clojure ", "reify ", "sync ", "time ", "when ", "when-first ", "when-let ", "when-not ", "while ", "with-bindings ", "with-in-str ", "with-loading-context ", "with-local-vars ", "with-open ", "with-out-str ", "with-precision ", "with-redefs ", "satisfies? ", "identical? ", "true? ", "false? ", "nil? ", "str ", "get ", "aget ", "aset ", "+ ", "- ", "* ", "/ ", "< ", "<= ", "> ", ">= ", "== ", "zero? ", "pos? ", "neg? ", "inc ", "dec ", "max ", "min ", "mod ", "bit-and ", "bit-and-not ", "bit-clear ", "bit-flip ", "bit-not ", "bit-or ", "bit-set ", "bit-test ", "bit-shift-left ", "bit-shift-right ", "bit-xor "} as text | cljs-generator.applescript |
set specialGroup to {".", "catch", "def", "do", "finally", "fn", "if", "let", "loop", "monitor-enter", "monitor-exit", "new", "quote", "recur", "set!", "throw", "try", "var"} | cljs-generator.applescript |
set condGroup to {"case", "cond", "cond->", "cond->>", "condp", "if-let", "if-not", "when", "when-first", "when-let", "when-not"} | cljs-generator.applescript |
set repeatGroup to {"doall", "dorun", "doseq", "dotimes", "while"} | cljs-generator.applescript |
set defineGroup to {"definline", "definterface", "defmacro", "defmethod", "defmulti", "defn", "defn-", "defonce", "defprotocol", "defrecord", "defstruct", "deftype"} | cljs-generator.applescript |
global badStuff, excludes, specialGroup, condGroup, repeatGroup, defineGroup | cljs-generator.applescript |
set const to {} | cljs-generator.applescript |
set bool to {} | cljs-generator.applescript |
set special to {} | cljs-generator.applescript |
set exception to {} | cljs-generator.applescript |
set cond to {} | cljs-generator.applescript |
set repeater to {} | cljs-generator.applescript |
set define to {} | cljs-generator.applescript |
set macros to {} | cljs-generator.applescript |
set funcs to {} | cljs-generator.applescript |
global special, cond, repeater, define | cljs-generator.applescript |
display dialog "Select vim-clojure-static/syntax/clojure.vim" | cljs-generator.applescript |
set synFile to choose file with prompt "syntax/clojure.vim" | cljs-generator.applescript |
if name of synFile is not ("clojure.vim") then | cljs-generator.applescript |
display dialog "Make sure you're using the correct vim-clojure-static/syntax/clojure.vim" & return & return & "https://github.com/guns/vim-clojure-static/tree/master/syntax" | cljs-generator.applescript |
set synRef to open for access synFile | cljs-generator.applescript |
set synContent to read synRef | cljs-generator.applescript |
close access synRef | cljs-generator.applescript |
set const to my parseSyn(synContent, const, "syntax keyword clojureConstant") | cljs-generator.applescript |
set bool to my parseSyn(synContent, bool, "syntax keyword clojureBoolean") | cljs-generator.applescript |
set special to my parseSyn(synContent, special, "syntax keyword clojureSpecial") | cljs-generator.applescript |
set exception to my parseSyn(synContent, exception, "syntax keyword clojureException") | cljs-generator.applescript |
set cond to my parseSyn(synContent, cond, "syntax keyword clojureCond") | cljs-generator.applescript |
set repeater to my parseSyn(synContent, repeater, "syntax keyword clojureRepeat") | cljs-generator.applescript |
set define to my parseSyn(synContent, define, "syntax keyword clojureDefine") | cljs-generator.applescript |
set macros to my parseSyn(synContent, macros, "syntax keyword clojureMacro") | cljs-generator.applescript |
set funcs to my parseSyn(synContent, funcs, "syntax keyword clojureFunc") | cljs-generator.applescript |
set cljsDefine to {"(ns ", "(defn- ", "(defn ", "(def ", "(:refer-clojure :exclude [", "(defmacro "} | cljs-generator.applescript |
display dialog "Please select the clojurescript/src folder" | cljs-generator.applescript |
set inputFol to choose folder with prompt "clojurescript/src" | cljs-generator.applescript |
if (exists folder ("clj") in inputFol) then | cljs-generator.applescript |
set cljFol to folder ("clj") in inputFol | cljs-generator.applescript |
if (exists folder ("cljs") in cljFol) then | cljs-generator.applescript |
set cljsFol to folder ("cljs") in cljFol | cljs-generator.applescript |
if (exists file ("core.clj") in cljsFol) then | cljs-generator.applescript |
set cljCore to file ("core.clj") in cljsFol as alias | cljs-generator.applescript |
display dialog "Make sure you're selecting the correct clojurescript folder!" & return & return & "(from: https://github.com/clojure/clojurescript/tree/master/src)" | cljs-generator.applescript |
if (exists folder ("cljs") in inputFol) then | cljs-generator.applescript |
set cljFol to folder ("cljs") in inputFol | cljs-generator.applescript |
if (exists file ("core.cljs") in cljsFol) then | cljs-generator.applescript |
set cljsCore to file ("core.cljs") in cljsFol as alias | cljs-generator.applescript |
set namespaces to {} | cljs-generator.applescript |
set tags to {} | cljs-generator.applescript |
repeat with defs in cljsDefine | cljs-generator.applescript |
set found to {} | cljs-generator.applescript |
set oldTID to AppleScript's text item delimiters | cljs-generator.applescript |
set AppleScript's text item delimiters to defs | cljs-generator.applescript |
set inputReference to open for access cljsCore | cljs-generator.applescript |
set fileContents to read inputReference | cljs-generator.applescript |
close access inputReference | cljs-generator.applescript |
set counter to count of text items in fileContents | cljs-generator.applescript |
repeat with i from 2 to counter | cljs-generator.applescript |
set oneText to text item i of fileContents | cljs-generator.applescript |
copy oneText to end of found | cljs-generator.applescript |
repeat with anitem in found | cljs-generator.applescript |
set AppleScript's text item delimiters to " " | cljs-generator.applescript |
set newTag to first text item of anitem | cljs-generator.applescript |
if text of defs = "(ns " then | cljs-generator.applescript |
set newTag to my replaceChars(newTag, " | cljs-generator.applescript |
", "") | cljs-generator.applescript |
set newTag to newTag & "/" | cljs-generator.applescript |
copy newTag to end of namespaces | cljs-generator.applescript |
if newTag starts with "^" then | cljs-generator.applescript |
set newMacro to second text item of anitem | cljs-generator.applescript |
if newMacro does not start with "*" then | cljs-generator.applescript |
set addition to my addToList(newMacro, funcs, namespaces) | cljs-generator.applescript |
Subsets and Splits