text
stringlengths
0
15.7k
source
stringlengths
6
112
set endYear to text 1 thru 4 of endDate
ReadBookTasks.applescript
set endMonth to text 5 thru 6 of endDate
ReadBookTasks.applescript
set endDay to text 7 thru 8 of endDate
ReadBookTasks.applescript
if (dateFormat = "mmddyyyy") then
ReadBookTasks.applescript
set endDateString to endMonth & "/" & endDay & "/" & endYear
ReadBookTasks.applescript
set endDate to date endDateString
ReadBookTasks.applescript
set dateString to deferMonth & "/" & deferDay & "/" & deferYear
ReadBookTasks.applescript
set deferDate to date dateString
ReadBookTasks.applescript
else if (dateFormat = "ddmmyyyy") then
ReadBookTasks.applescript
set endDateString to endDay & "/" & endMonth & "/" & endYear
ReadBookTasks.applescript
set dateString to deferDay & "/" & deferMonth & "/" & deferYear
ReadBookTasks.applescript
set numDays to ((endDate - deferDate) div days) + 1
ReadBookTasks.applescript
tell document of front window
ReadBookTasks.applescript
set pagesPer to numPages / numDays
ReadBookTasks.applescript
set startPage to 1
ReadBookTasks.applescript
set endPage to pagesPer as integer
ReadBookTasks.applescript
set taskTitle to "Read pages " & startPage & " - " & endPage & " of " & bookTitle
ReadBookTasks.applescript
set theTag to first flattened tag where its name is myTag
ReadBookTasks.applescript
set newTask to make new inbox task with properties {name:taskTitle, defer date:deferDate, primary tag:theTag}
ReadBookTasks.applescript
repeat (numDays - 1) times
ReadBookTasks.applescript
set startPage to endPage + 1
ReadBookTasks.applescript
set endPage to round (pagesPer * i) rounding up
ReadBookTasks.applescript
set deferDate to deferDate + (60 * 60 * 24)
ReadBookTasks.applescript
return bookTitle & ": " & numPages
ReadBookTasks.applescript
display dialog "Hello world!"
hello-world.applescript
set windowWidth to 800
center.applescript
set windowHeight to 600
center.applescript
set res to text returned of (display dialog "Enter the width x height:" default answer ((windowWidth & windowHeight) as text))
center.applescript
if res is "" then
center.applescript
display dialog "You need to enter a correct response"
center.applescript
set {windowWidth, windowHeight} to text items of res
center.applescript
set screen_width to (do JavaScript "screen.availWidth" in document 1)
center.applescript
set screen_height to (do JavaScript "screen.availHeight" in document 1)
center.applescript
set {desktopTop, desktopLeft, desktopRight, desktopBottom} to bounds of desktop
center.applescript
tell process myFrontMost
center.applescript
set {{w, h}} to size of drawer of window 1
center.applescript
set {w, h} to {0, 0}
center.applescript
set position of window 1 to {((screen_width - windowWidth) / 2), ((screen_height - windowHeight) / 2.0) - desktopTop}
center.applescript
set size of window 1 to {windowWidth -w, windowHeight}
center.applescript
on status(local_repo_path, option)
GitParser.applescript
return do shell script "cd " & local_repo_path & ";" & git_path & "git status" & " " & option
GitParser.applescript
end status
GitParser.applescript
on do_log(local_repo_path, cmd)
GitParser.applescript
set shell_cmd to "cd " & local_repo_path & ";" & git_path & "git log " & cmd
GitParser.applescript
end do_log
GitParser.applescript
on diff(local_repo_path, cmd)
GitParser.applescript
return do shell script "cd " & local_repo_path & ";" & git_path & "git diff " & cmd
GitParser.applescript
on unmerged_files(local_path)
GitParser.applescript
set unmerged_paths to diff(local_path, "--name-only --diff-filter=U")
GitParser.applescript
return paragraphs of unmerged_paths
GitParser.applescript
end unmerged_files
GitParser.applescript
on origin_url(local_repo_path)
GitParser.applescript
set shell_cmd to "cd " & local_repo_path & ";" & git_path & "git config --get remote.origin.url"
GitParser.applescript
end origin_url
GitParser.applescript
on cherry(local_repo_path, branch)
GitParser.applescript
set loc to "origin" --"https://" & user_name & ":" & user_password & "@" & remote_repo_url
GitParser.applescript
return do shell script "cd " & local_repo_path & ";" & git_path & "git cherry" & " -v " & loc & "/" & branch --TODO: whats the -v, verbose?
GitParser.applescript
end cherry
GitParser.applescript
UI elements
UI elements.applescript
set front_app to name of (path to frontmost application)
kindlecontrol.applescript
if not front_app = "Kindle.app" then
kindlecontrol.applescript
tell application "Kindle"
kindlecontrol.applescript
if (item 1 of argv) = "n" then
kindlecontrol.applescript
else if (item 1 of argv) = "p" then
kindlecontrol.applescript
property name : "files"
+files.applescript
property id : "chri.sk.applescript.lib:files"
+files.applescript
property sys : application "System Events"
+files.applescript
property Finder : application "Finder"
+files.applescript
property unset : 0
+files.applescript
property orange : 1
+files.applescript
property red : 2
+files.applescript
property yellow : 3
+files.applescript
property blue : 4
+files.applescript
property purple : 5
+files.applescript
property green : 6
+files.applescript
property grey : 7
+files.applescript
to make new fileitem : file at path as text
+files.applescript
if the path exists then return false
+files.applescript
tell sys to make new fileitem with properties {name:path}
+files.applescript
alias (path of result)
+files.applescript
on __sys__(fp as text)
+files.applescript
a reference to sys's alias fp
+files.applescript
end __sys__
+files.applescript
to __alias__(fp as text)
+files.applescript
__sys__(fp) as alias
+files.applescript
end __alias__
+files.applescript
on __finder__(fp as text)
+files.applescript
Finder's item __alias__(fp)
+files.applescript
end __finder__
+files.applescript
on exists (fp as text)
+files.applescript
__sys__(fp) exists
+files.applescript
end exists
+files.applescript
to delete fs
+files.applescript
repeat with f in fs
+files.applescript
set f's contents to __finder__(f)
+files.applescript
delete fs
+files.applescript
end delete
+files.applescript
on dir(fp as text)
+files.applescript
[__alias__(fp), "::"] as text as alias
+files.applescript
POSIX path of result
+files.applescript