Skip to content
This repository has been archived by the owner on Jan 31, 2019. It is now read-only.

Commit

Permalink
replace binary files with text files
Browse files Browse the repository at this point in the history
  • Loading branch information
vol0da committed Jan 20, 2011
1 parent b885f89 commit d7894c0
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 0 deletions.
35 changes: 35 additions & 0 deletions TaskPaper/DoneWithDateTime.applescript
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 removed TaskPaper/DoneWithDateTime.scpt
Binary file not shown.
33 changes: 33 additions & 0 deletions TaskPaper/StartWithDateTime.applescript
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 removed TaskPaper/StartWithDateTime.scpt
Binary file not shown.

0 comments on commit d7894c0

Please sign in to comment.