Cycle Through Workspaces

Not long ago, my buddy Seth walked me through a bit of his Drafts setup. He’s been creating a lot more workspaces as of late, but didn’t think the workspace switching actions I had created before were enough, and he wanted a better way to cycle through them.

My coding skills aren’t that great, and quite frankly, are rusty as hell because I haven’t really done a lot of it due to other commitments. At the time, I was preparing for some big reviews at work, so I didn’t even have time to look into it. Seth then reached out to the Drafts Community. It did take long before Jacob (jsamlarose) answered the call and created the action Seth requested. (Great work, Jacob!)

After discussing this over the phone with Seth, he was elated at his new method of switching. But he also wanted to cycle this in reverse as well. A quick search later, I found the .reverse() javascript function, and simply added the line under the first line of the script. This reverses the array created in the line above, and then the rest of the script works in the same way. I ended up renaming the actions to Cycle Workspace FWD and Cycle Workspace REV and changing the icons used, along with changing the keyboard actions to ⌘→ and ⌘← respectively.

This is just something simple that’s really great and really effective. I think too often we can complicated the automation of different things and set our sights on creating complex actions (or shortcuts) to make our lives better. I’m finding that more and more, the simplest actions tend to be the right ones.

On This Date

Even though Seth and I no longer have a podcast, we still talk nearly daily about a lot of things. One of them is Drafts, and how we are using it for small life improvements here and there. Journaling is one of them, and it has become a part of standard practice for me. I don’t always have to put something in that’s poignant, but I do document quite a bit from time to time. I’m not perfect at it, but I try to do the best that I can. After all, it’s for me – so if I don’t do well at it, I’m only disappointing myself…

I journal using Drafts because I trust the system. Using Shortcuts, I run an automation in the morning to create the entry at 4:00am so I never miss a day; this entry is created in a specific format with the journal tag, date heading in yyyy-mm-dd format, and some weather and date information. I have another automation that runs just before midnight to save it as a nice-looking PDF at night and archive the draft. I still keep all the journal entries in Drafts: they live in my Journal workspace in the archive folder at the top of the drafts list. I keep them just in case I need to search for something later, even though I hardly do it. But there are times where I might want to go back and review them just to see what happened in the past. One of Seth’s problems was that he wanted a way to review things that happened on that day throughout the life of his digital journal. We used to use Shortcuts to do this, but that’s cumbersome at best. Why use another app when Drafts is perfectly suited for this? Seth ended up finding this forum tip on creating temporary workspaces, which admittedly was from a while ago (November 2018). Even though a lot of you think I’m an expert, there’s quite a bit of this stuff that I don’t know or use.

Using this example, I was able to create an action to show what happened On This Date. In simple terms, it searches for all drafts tagged journal, then searches for a string of the current date in mm-dd format; the action then has some code to let you filter the look of it, then load the workspace. I added a few things because I want to keep my Journal themes applied when creating this temporary workspace.

Let’s walk through the code a bit. First, you’ll find some configurable variables for your searching. This sets the name of the temporary workspace, the tags you want to include (or omit using !tag), and some strings to search.

//BEGIN config variables
//setup tags or searches you wish to load...
let name = "On This Date";
let tagFilter = "journal"
const now = new Date()
const date = now.toString("MM-dd")
let queryString = date;
let group = ActionGroup.find("Journal");
app.loadActionGroup(group);
let lTheme = Theme.find("custom", "Journal Light");
let dTheme = Theme.find("custom", "Journal Dark");
//END config variables

I also added the action groups I use for journaling as well as my journaling themes as variables, since I want to make sure I use them later in the action. Now that all that is configured, we can set up the workspace:

//create workspace
//for other options, see:
//https://reference.getdrafts.com/objects/Workspace.html
let ws = Workspace.create();
ws.name = name;
ws.tagFilter = tagFilter;
ws.queryString = queryString;
ws.setInboxSort("created", true);
ws.loadFolder = "all";
ws.showPreview = false;
ws.showTags = false;
ws.showLastAction = false;
ws.showDate = false;
ws.loadActionBarGroup = group;
ws.loadActionListGroup = group;
//ws.lightTheme = lTheme;
//ws.darkTheme = dTheme;

There’s a surprising amount of customization. I did find out that there was an undocumented .showDate customization that I could take advantage of. The only thing I would like to see added here is .lightTheme and .darkTheme so that I can set the themes directly with the temporary workspace which would eliminate the need for me to call them using the other methods; maybe those will get added in the future. The last part applies the workspace, shows the draft list, and applies my themes. I appreciated the callout in the original action, so I kept it in there: the workspace is temporary unless you use the .update() function, very much akin to a temporary draft to store information.

//unless you call `ws.update()`, this ws is temporary
//load this workspace, and display draft list
app.applyWorkspace(ws);
app.showDraftList();

//set the Journal themes
app.lightTheme = lTheme;
app.darkTheme = dTheme;

Actions like this can seem like a lot at first, but they are fairly simple enough to manage. This action can bring a lot of awareness and possibly even some joy to your day, looking back on the things you’ve done in the past. I’ve also included this in my widgets: I’ve found that I use it more often this way, and it’s a great use of a widget action for Drafts.


I have to admit, this is the first time in a while that I’ve done something like this to change some of my workflows. Not because I don’t adore Drafts, but because of how life has been going for me (all good things, thankfully). But it makes me wonder: what else am I missing? Seems like a great time to go exploring…

Clear Spaces for a Clear Mind

I get asked often for what’s on my Home Screen: what apps, what wallpaper, what layout. Now with iOS 14, I’m asked about my widget setup as well. I’ve shared some updates through posts and social media sporadically. A lot of my current setup is visually unchanged (except the wallpaper), but I wanted to cover the why of the Home Screen – where apps/widgets are placed, what stacks are being used, and now I’m using them together for a more streamlined, productive setup.
More “Clear Spaces for a Clear Mind”