This repository has been archived by the owner on Jan 31, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
replace binary files with text files
- Loading branch information
Showing
4 changed files
with
68 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
on getCurrentDate() | ||
set theDate to current date | ||
|
||
set {month:m, day:d, year:y, time:t} to theDate | ||
|
||
set theMonth to month of theDate as integer | ||
set theDay to day of theDate | ||
set theYear to year of theDate | ||
set t to time of theDate | ||
|
||
set theHour to round (t / (60 * 60)) rounding down | ||
set theMinute to round (t - (theHour * 60 * 60)) / 60 rounding down | ||
|
||
if theDay as integer < 10 then | ||
set theDay to "0" & theDay | ||
end if | ||
if theMinute as integer < 10 then | ||
set theMinute to "0" & theMinute | ||
end if | ||
|
||
set textDate to (theYear as string) & "-" & theMonth & "-" & theDay & " " & theHour & ":" & theMinute | ||
return textDate | ||
end getCurrentDate | ||
|
||
tell application "TaskPaper" | ||
tell front document | ||
tell selected entry | ||
if not (exists tag named "done") then | ||
make tag with properties {name:"done", value:my getCurrentDate()} | ||
else | ||
delete tag named "done" | ||
end if | ||
end tell | ||
end tell | ||
end tell |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
on getCurrentDate() | ||
set theDate to current date | ||
|
||
set {month:m, day:d, year:y, time:t} to theDate | ||
|
||
set theMonth to month of theDate as integer | ||
set theDay to day of theDate | ||
set theYear to year of theDate | ||
set t to time of theDate | ||
|
||
set theHour to round (t / (60 * 60)) rounding down | ||
set theMinute to round (t - (theHour * 60 * 60)) / 60 rounding down | ||
|
||
if theDay as integer < 10 then | ||
set theDay to "0" & theDay | ||
end if | ||
if theMinute as integer < 10 then | ||
set theMinute to "0" & theMinute | ||
end if | ||
|
||
set textDate to (theYear as string) & "-" & theMonth & "-" & theDay & " " & theHour & ":" & theMinute | ||
return textDate | ||
end getCurrentDate | ||
|
||
tell application "TaskPaper" | ||
tell front document | ||
tell selected entry | ||
if not (exists tag named "start") then | ||
make tag with properties {name:"start", value:my getCurrentDate()} | ||
end if | ||
end tell | ||
end tell | ||
end tell |
Binary file not shown.