text
stringlengths 0
15.7k
| source
stringlengths 6
112
|
---|---|
set positions to {"main_frames", "left_frames", "right_frames", "top_frames", "bottom_frames"} | getCurrentFrame.applescript |
repeat with i from 1 to length of positions | getCurrentFrame.applescript |
set pos to item i of positions | getCurrentFrame.applescript |
set frames to rb's getKeyValue(vframes, pos) | getCurrentFrame.applescript |
repeat with i from 1 to frames's length | getCurrentFrame.applescript |
set f to item i of frames | getCurrentFrame.applescript |
if x ≥ gf's getFrameOriginX(f) and x ≤ (gf's getFrameOriginX(f)) + (gf's getFrameWidth(f)) and y ≥ gf's getFrameOriginY(f) and y ≤ (gf's getFrameOriginY(f)) + (gf's getFrameHeight(f)) then | getCurrentFrame.applescript |
return {pos, i, vframes} | getCurrentFrame.applescript |
return 0 | getCurrentFrame.applescript |
end getCurrentFrame | getCurrentFrame.applescript |
on getCurrentFrameSA(x, y) | getCurrentFrame.applescript |
set getFrameScpt to scriptPath & "getFrame.scpt" | getCurrentFrame.applescript |
set gf to load script file getFrameScpt | getCurrentFrame.applescript |
set vframes to gf's getAllVisibleFrames() | getCurrentFrame.applescript |
return getCurrentFrame(x, y, vframes) | getCurrentFrame.applescript |
end getCurrentFrameSA | getCurrentFrame.applescript |
set pList to name of every process whose frontmost is true | getCurrentFrame.applescript |
set appName to item 1 of pList | getCurrentFrame.applescript |
tell process appName | getCurrentFrame.applescript |
set topWindow to item 1 of (every window whose focused is true) | getCurrentFrame.applescript |
set topWindow to window 1 | getCurrentFrame.applescript |
set winPos to position of topWindow | getCurrentFrame.applescript |
set winPosX to item 1 of winPos | getCurrentFrame.applescript |
set winPosY to item 2 of winPos | getCurrentFrame.applescript |
return getCurrentFrameSA(winPosX, winPosY) | getCurrentFrame.applescript |
on appIsRunning(appName) | sublime_new.applescript |
tell application "System Events" to (name of processes) contains appName | sublime_new.applescript |
end appIsRunning | sublime_new.applescript |
if appIsRunning("Sublime Text") then | sublime_new.applescript |
tell process "Sublime Text" to click menu item "New Window" in menu "File" of menu bar 1 | sublime_new.applescript |
tell application "Sublime Text" to activate | sublime_new.applescript |
log {1, 2} contains 2 -- true | containment.applescript |
log {1, 2, 3} contains {2, 3} -- true | containment.applescript |
log {1, 2, 3} contains {1, 3} -- false -- lists are orderd, and items must be compared in sequence | containment.applescript |
log {name:"Matt", age:"51"} contains {name:"Matt"} -- true | containment.applescript |
log {name:"Matt", age:"51"} contains {age:"51", name:"Matt"} -- true | containment.applescript |
log 2 is in {1, 2} | containment.applescript |
log "XXXXXXX" | containment.applescript |
log {1, 2} ends with 2 -- true | containment.applescript |
set json_path to file "json.scpt" of folder of (path to me) | tests.applescript |
set json to load script (json_path as alias) | tests.applescript |
on assert_eq(a, b) | tests.applescript |
if not a = b then | tests.applescript |
set aq to quoted form of a as text | tests.applescript |
set bq to quoted form of b as text | tests.applescript |
error "values not equal:" & aq & " != " & bq | tests.applescript |
assert_eq(json's hex4(0), "0000") | tests.applescript |
assert_eq(json's hex4(1), "0001") | tests.applescript |
assert_eq(json's hex4(11), "000b") | tests.applescript |
assert_eq(json's hex4(2*16), "0020") | tests.applescript |
assert_eq(json's hex4(65534), "fffe") | tests.applescript |
assert_eq(json's hex4(65535), "ffff") | tests.applescript |
assert_eq(json's hex4(65536), "0000") | tests.applescript |
assert_eq(json's hex4(65537), "0001") | tests.applescript |
assert_eq(json's encode(1), "1") | tests.applescript |
assert_eq(json's encode(0), "0") | tests.applescript |
assert_eq(json's encode(true), "true") | tests.applescript |
assert_eq(json's encode(false), "false") | tests.applescript |
assert_eq(json's encode("foo"), "\"foo\"") | tests.applescript |
assert_eq(json's encode(""), "\"\"") | tests.applescript |
assert_eq(json's encode("\n"), "\"\\u000a\"") | tests.applescript |
assert_eq(json's encode("ș"), "\"\\u0219\"") | tests.applescript |
assert_eq(json's encode("u" & "̈"), "\"u\\u0308\"") | tests.applescript |
assert_eq(json's encode("\"bar\""), "\"\\\"bar\\\"\"") | tests.applescript |
assert_eq(json's encode("\\"), "\"\\\\\"") | tests.applescript |
assert_eq(json's encode({1, 2, 3}), "[1, 2, 3]") | tests.applescript |
assert_eq(json's encode(json's createDict()), "{}") | tests.applescript |
set dict to json's createDictWith({{"foo", "bar"}}) | tests.applescript |
assert_eq(json's encode(dict), "{\"foo\": \"bar\"}") | tests.applescript |
set dict2 to json's createDictWith({{"a", 13}, {"b", {2, "other", dict}}}) | tests.applescript |
assert_eq(json's encode(dict2), "{\"a\": 13, \"b\": [2, \"other\", {\"foo\": \"bar\"}]}") | tests.applescript |
log "ok" | tests.applescript |
repeat until isSynchronizing is false | Create Omnifocus Tasks for Notes.applescript |
set theNotes to the selection | Create Omnifocus Tasks for Notes.applescript |
repeat with theNote in theNotes | Create Omnifocus Tasks for Notes.applescript |
set theUrl to the note link of theNote | Create Omnifocus Tasks for Notes.applescript |
set theTitle to the title of theNote | Create Omnifocus Tasks for Notes.applescript |
tell default document | Create Omnifocus Tasks for Notes.applescript |
make new inbox task with properties {name:theTitle, note:theUrl} | Create Omnifocus Tasks for Notes.applescript |
set torrentsLocation to "/Users/Jelly/Torrents" | AutoConvert.scpt |
set handbrakeLocation to "/Applications/Utilities/HandBrakeCLI" | AutoConvert.scpt |
on fileExists(posixFile) | AutoConvert.scpt |
if not (exists posixFile as alias) then return false | AutoConvert.scpt |
end fileExists | AutoConvert.scpt |
on replaceText(find, replace, someText) | AutoConvert.scpt |
set prevTIDs to text item delimiters of AppleScript | AutoConvert.scpt |
set text item delimiters of AppleScript to find | AutoConvert.scpt |
set someText to text items of someText | AutoConvert.scpt |
set text item delimiters of AppleScript to replace | AutoConvert.scpt |
set someText to "" & someText | AutoConvert.scpt |
set text item delimiters of AppleScript to prevTIDs | AutoConvert.scpt |
end replaceText | AutoConvert.scpt |
set activityLog to do shell script "/bin/ps -ax" | AutoConvert.scpt |
set segmentedActivityLog to (every word of activityLog) | AutoConvert.scpt |
set isRunning to segmentedActivityLog contains "HandBrakeCLI" | AutoConvert.scpt |
if isRunning = false then | AutoConvert.scpt |
set allFiles to every file of entire contents of (POSIX file torrentsLocation as alias) whose ((name extension is "avi" or name extension is "mkv") and label index is 0) | AutoConvert.scpt |
repeat with i from 1 to number of items in allFiles | AutoConvert.scpt |
set currentFile to (item i of allFiles) | AutoConvert.scpt |
if label index of currentFile is not 0 then exit repeat | AutoConvert.scpt |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.