- Registriert
- 22.05.08
- Beiträge
- 307
Hallo,
Ich habe mir ein AppleScript geschrieben um mir meine ToDos aus Things mit geekTool auf dem Desktop anzeigen zu lassen.
Leider ist die Performance echt unterirdisch - 5sek Laufzeit und eine hohe Prozessorauslastung sind einfach nicht annehmbar.
Leider gehen mir die Ideen zum optimieren aus, was auch daraus resultiert, dass ich mich in Applescript nicht so gut auskenne.
Vielleicht kann sich ja jemand hier das Script ansehen:
Natürlich darf jeder der möchte das Script für sich verändern und nutzen.
Meine zweite Idee wäre, das Script in einer anderen Sprache mit Osascript-Bindings zu schreiben. Aber ich bin mir nicht sicher ob sich das lohnt, und ob das Bottleneck nicht doch die Anwendung ist.
Ich habe mir ein AppleScript geschrieben um mir meine ToDos aus Things mit geekTool auf dem Desktop anzeigen zu lassen.
Leider ist die Performance echt unterirdisch - 5sek Laufzeit und eine hohe Prozessorauslastung sind einfach nicht annehmbar.
Leider gehen mir die Ideen zum optimieren aus, was auch daraus resultiert, dass ich mich in Applescript nicht so gut auskenne.
Vielleicht kann sich ja jemand hier das Script ansehen:
Code:
global lineLimit
global lineCount
global noDuplicates
global alreadyShown
-- modify section
set lineLimit to 36
set noDuplicates to true
-- end of modify section
set lineCount to 0
set alreadyShown to {}
on getListContents(aList, aLimit)
tell application "Things"
set fullReport to aList & "\n"
set lineCount to lineCount + 1 -- We have started a new line
set itemCount to 1
repeat with aToDo in (to dos of list aList where status is open)
if lineCount < aLimit then
if noDuplicates and id of aToDo is in alreadyShown then
else
set fullReport to fullReport & (itemCount as string) & ".\t" & (name of aToDo) & "\n"
set lineCount to lineCount + 1
set itemCount to itemCount + 1
if noDuplicates then
set alreadyShown to alreadyShown & (id of aToDo)
end if
end if
end if
end repeat
return fullReport
end tell
end getListContents
set today to getListContents("Today", lineLimit) & "\n"
set lineCount to lineCount + 1
set next to getListContents("Next", lineLimit - lineCount)
return today & "\n" & next
Meine zweite Idee wäre, das Script in einer anderen Sprache mit Osascript-Bindings zu schreiben. Aber ich bin mir nicht sicher ob sich das lohnt, und ob das Bottleneck nicht doch die Anwendung ist.