Skip to content

Commit

Permalink
Export Things URLs in csv
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderWillner committed Jan 9, 2018
1 parent 928d357 commit bd8db2c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ Days/Task : 41.0
## Things URL Helper

The application ```ThingsURLHelper.app``` opens URLs of the form ```thingstodo:show?uuid=XXX``` with XXX being the ```UUID``` of a todo.
By using ```things.sh search``` you can identify the ```UUID``` of a task.
By using ```things.sh csv``` you can identify the according URL of each task and open it via spotlight for example.

## CREDITS
* Author : Arjan van der Gaag (script for Things 2)
Expand Down
4 changes: 3 additions & 1 deletion plugins/csv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ myPluginMethod="exportCSV"
eval "$myPlugin=('$myPluginCommand' '$myPluginDescription' '$myPluginMethod')"

exportCSV() {
echo 'Title;"Creation Date";"Modification Date";"Due Date";"Start Date";"Completion Date";"Recurring";Project;Area;Subtask;Notes'
echo 'Title;"URI";"Creation Date";"Modification Date";"Due Date";"Start Date";"Completion Date";"Recurring";Project;Area;Subtask;Notes'
sqlite3 -list -separator ';' "$THINGSDB" "$(getCSVQuery1)" | awk '{gsub("<[^>]*>", "")}1' | iconv -c -f UTF-8 -t WINDOWS-1252//TRANSLIT || true
sqlite3 -list -separator ';' "$THINGSDB" "$(getCSVQuery2)" | awk '{gsub("<[^>]*>", "")}1' | iconv -c -f UTF-8 -t WINDOWS-1252//TRANSLIT || true
}
Expand All @@ -18,6 +18,7 @@ getCSVQuery1() {
read -rd '' query <<-SQL || true
SELECT
T1.title,
'thingstodo:show?uuid='||T1.uuid,
date(T1.creationDate,"unixepoch"),
date(T1.userModificationDate,"unixepoch"),
date(T1.dueDate,"unixepoch"),
Expand All @@ -40,6 +41,7 @@ getCSVQuery2() {
read -rd '' query <<-SQL || true
SELECT
T2.title,
'thingstodo:show?uuid='||T2.uuid,
date(T1.creationDate,"unixepoch"),
date(T1.userModificationDate,"unixepoch"),
"",
Expand Down
3 changes: 1 addition & 2 deletions plugins/search.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ SELECT
date(T1.startDate,"unixepoch") as "Start",
date(T1.stopDate,"unixepoch") as "Stopped",
T2.title as "Project",
T3.title as "Area",
'thingstodo:show?uuid='||T1.uuid
T3.title as "Area"
FROM $TASKTABLE T1
LEFT OUTER JOIN $TASKTABLE T2 ON T1.project = T2.uuid
LEFT OUTER JOIN $AREATABLE T3 ON T1.area = T3.uuid
Expand Down

0 comments on commit bd8db2c

Please sign in to comment.