Member
2012-12-27, 04:39 AM
Quote:
Originally Posted by RobTrew
In the meanwhile, if you want to check that there are no midnight starts, you can do a search and replace with applescript.
Or maybe there are new ways to change default start time?
Something like this, for example:
Code:
-- Find and replace start dates
-- Edit properties below (integers in range 0 - 24 for hours, 0 - 60 for minutes)
property pFindHours : 0
property pFindMins : 0
property pReplaceHours : 6 -- Desired start (hours)
property pReplaceMins : 0 -- Desired start (mins)
on run
tell application id "com.omnigroup.omnifocus"
tell default document
set lstTasks to (flattened tasks where start date is not missing value)
set lngChanges to 0
repeat with i from 1 to length of lstTasks
set dteStart to start date of item i of lstTasks
tell dteStart
if (its hours = pFindHours and its minutes = pFindMins) then
set {its hours, its minutes} to {pReplaceHours, pReplaceMins}
set start date of item i of lstTasks to dteStart
set lngChanges to lngChanges + 1
end if
end tell
end repeat
end tell
end tell
display dialog (lngChanges as string) & " start dates changed from " & PadNum(pFindHours, 2) & ":" & PadNum(pFindMins, 2) & ¬
" to " & PadNum(pReplaceHours, 2) & ":" & PadNum(pReplaceMins, 2) with title "Find & Replace Start Time"
end run
on PadNum(lngNum, lngDigits)
set strNum to lngNum as string
set lngGap to (lngDigits - (length of strNum))
repeat while lngGap > 0
set strNum to "0" & strNum
set lngGap to lngGap - 1
end repeat
strNum
end PadNum
|
Could anyone kindly provide me with an instruction on how to adjust the start time using this script?
|