Table of contents
This use case is for if you want to disable the automated checks for a Doctor Drafts workflow update and run it on your own schedule instead. For example, every Monday at 9 AM.
For this use case, we are therefore going to use a custom external trigger to create a custom flow to call the standard workflow update check.
Add the variable
UCfrequency to the Doctor Drafts workflow, and set its value to
-1. This will stop the workflow triggering its own periodic check.
The flow to do this consists of three sequential blocks.
The first block is an
Inputs > External block, and sets up the a way that will allow us to call our flow from another place.
The next block is a
Utilities > Args and Vars block. It sets three variables:
shownoupdateis set to
TRUE, to ensure that the workflow shows a notification when it is run and not only when it finds an update. Leave out this variable if you only want a notification if there is something to update to.
UCfrequencyis set to
0, just in case you do want to run the workflow’s normal periodic check. Setting this variable to zero essentially makes the flow we are going to call to do the checking always do the checking.
UClastcheckedis set to
0. This is just a “belt and braces” step to ensure that it has always been the maximum amount of time since the last check and so a check is due.
The final step is to link an
Outputs > Call External Trigger block. If you select the Workflow Triggers… button, this will allow you to select from the list of available triggers and will populate the Workflow ID and Trigger ID fields, with no risk of typos. Here we are selecting the
drwfu trigger ID from Doctor Drafts.
If you take a look at the Flow - drwfu page in the Documentation section, it explains how it works, and what variables it expects to be set. Note in the above screenshot that the Pass input as argument and Pass variables options are set. The second of these is critical to this working correctly.
Here the flow is named
mycheck1, and is in my “Doctor Drafts - Examples” workflow. you can see this in the screenshot of the first block. You can also see some AppleScript provided to call the flow. Since we do not need a query to be passed through, I can use the following AppleScript.
tell application id "com.runningwithcrayons.Alfred" to run trigger "mycheck1" in workflow "com.thoughtasylum.doctordraftsexamples"
I use Keyboard Masetro for most of my script scheduling, but you really are at liberty to use whatever you like, including the Mac standard, launchd.
osascript can be used to run the AppleScript from the command line, so your options should be wide open on this one.
The standard approach offered by the Doctor Drafts workflow is based on days elapsed since it last checked. However, if you use an external scheduler, this will check even if you have not used Doctor Drafts for a while, and can be set to check on a schedule not based around a number of days elapsed.