Table of contents
Flow - wfu
Description
This workflow will carry out the operations required for automated checking for an update to the Doctor Drafts workflow based on a number of criteria. The workflow is called when other flows complete, and can be called directly.
When called, it may examine when the last check was carried out and the frequency of checks to determine if a new check should be made.
It will not carry out a check if no Internet connection is available. If a connection is available, the Doctor Draft website is queried for the latest version number which is compared against the local version number. If the remote version number on the website is greater than the local workflow version number, then this signifies an update is available.
When an update is found a notification will be made (visual and audible), and optionally a notification (visual) may be made if no update is found.
Variables
Used
The following variables can be passed in and will be processed by the flow.
Variable | Description |
---|---|
shownoupdate | If this variable is set to TRUE , a notification will be displayed to idicate no update was carried out. This will default to not existing and so no notification sill be displayed. |
UCfrequency | The frequency (in days) to check for updates. -1 will be never, 0 will be every time, 1 will be daily, 7 will be weekly, 28 will be every four weeks, etc. The default is weekly. |
UClastchecked | This is set the numeric date representation of when a check was last completed - e.g. 31 December 2021 would be 20211231 . It will default to 0 to ensure that an initial check is carried out. |
UCSoundPath | Set this to the path of the sound file to play when an update is found. It defaults to /System/Library/Sounds/submarine.aiff . Setting it to say will instead make the following verbal announcement - "An update to the Doctor Drafts workflow is available" . |
Created
The following variables are set-up by the flow.
Variable | Description |
---|---|
UClastchecked | This is set to the current date on occasions where a check is completed - e.g. 31 December 2021 would be 20211231 . |
Termination
- Post Notification.
- Save
UClastchecked
if relevant.
Flow
Scripting
Sample Code (AppleScript)
tell application id "com.runningwithcrayons.Alfred"
set configuration "shownoupdate" to value "TRUE" in workflow "com.thoughtasylum.doctordrafts"
set configuration "UCfrequency" to value 0 in workflow "com.thoughtasylum.doctordrafts"
set configuration "UClastchecked" to value 0 in workflow "com.thoughtasylum.doctordrafts"
run trigger "drwfu" in workflow "com.thoughtasylum.doctordrafts"
end tell
Notes
- This flow does not call
drcomplete
. If it were to do this, it is possible it could end up stuck in an infinite loop becausedrcomplete
also calls this flow.