Suggestion: add workspaces to sidebar, make dynamic

I use workspaces quite a lot to navigate between projects, but had a couple thoughts that might improve its usability:

(1) add them to the side bar to make them more discoverable. They fit logically with the other ways to navigate content, such as smart groups and tags. It’d be

(2) make them less like a static bookmark, and more dynamic like Photoshop’s workspaces. When you select a workspace in Photoshop, it first positions all the palettes and windows based on the saved settings. But that workspace remains “active” — if you adjust the position/size of a palette or window, the workspace automatically remembers those new settings. This lets you create “work environments” that remember your last actions, making it easy to return later.

1 Like

Actually a workspace is not some kind of navigation, it’s just a setup of opened databases, windows & tabs.

At least so far it was actually intentional that it’s not working that way but workspaces can be updated via Go > Workspaces > Update.

Right, and I use it to create a workspace for each project I am working on: defining for each project the databases and groups I need visible, and the document i need to be active.

The only issue about doing this is that I need to remember that if I changed anything (opened additional groups, switched documents), I need to remember to update my workspace. And the interface gives me no indication that my current setup is different from the selected workspace.

This is why I was thinking of how workspaces could be more prominent (the sidebar feels like a logical location). And more dynamic, where when I am “in a workspace” for a project, it will automatically save any changes I make.

Does that make sense?

Sure. We’ll consider such an option for future releases depending on feedback (the list of possible improvements is already endless).

Thinking a little more about this: I think I’d even just be happy if there was just a key command for the menu item “update workspace-name”.

This way, if I was working on a project, I would first select its workspace. Then, as I open and close groups/windows/documents, I could just hit shift-command-S (or whatever) to preserve my project’s current setup.

Alas, we can’t do this via the Apple OS keyboard shortcuts — since the menu item contains the name of the workspace. Does anyone know if any other keyboard shortcut app could handle this?

Something like this? It’s a script fork from your own script here Script to select workspace

I just add a few lines. After u choose a workspace from your list, one more dialogue to ask whether u want to save or load the selected workspace. (1) It seems there is no command to create workspace by script though. So u can only choose to load or save existing workspaces. If this is not what u need, my apology. (2) I haven’t fully tested the script…

EDITED. It seems that ur original script does not close all existing think windows before loading a workspace. Therefore, I just added one more line to close all current think windows before loading the workspace (for “Load” action only).

One more suggestion. Create N dummy files, each named as one of your workspace. Put them under “Favourites”. Since the name of the dummy files are the same as the workspaces, just add two more lines of script (1) un-flag or un-label all dummies (2) label or flag the dummy file with the same name as the selected workspace (“set the label of record at “/…/…/dummyname” to 1” or something like that). That way you will always know which workspace is activated.

use AppleScript version "2.4" -- Yosemite (10.10) or later
use scripting additions


tell application id "DNtp"
	try
		set theWorkspaces to workspaces
		choose from list theWorkspaces
		if the result is not false then
			set theSelection to item 1 of the result
			set action to text 1 of button returned of (display dialog ("Choose action") with title "Load or update workspace" buttons {"Cancel", "Load", "Save"} default button 2)
			if action is "L" then
                close every think window
				load workspace theSelection
			else if action is "S" then
				save workspace theSelection
			end if
		end if
	end try
end tell

Another very quick and dirty script to create a list of dummy files in a location chosen by you that named the same as all workspaces. With this, you don’t have to manually create the dummies…

tell application id "DNtp"
	
	set ws to workspaces
	set l to {}
	set theWSDummyLocation to display group selector "Create the dummmy files in:" for current database
	repeat with i from 1 to length of ws
		set theNewDoc to create record with {name:(item i of ws) as string, source:"" as string, type:rtf} in theWSDummyLocation		
	end repeat
	
end tell

Thanks for that! It needed it!

Man you are the scripting master!

Yes, this looks like the starting point of something that could work well! Adding the save/load dialog works, although is a little chunky to use. One simple solution would be to just create two separate scripts: that that loads a workspace, and one that saves to a workspace. And then adding the scripts as buttons in the toolbar.

-- save current workspace

use AppleScript version "2.4" -- Yosemite (10.10) or later
use scripting additions

tell application id "DNtp"
	try
		set theWorkspaces to workspaces
		set mychoice to (choose from list theWorkspaces with prompt "Save this workspace to:" default items "None" OK button name {"Save"} cancel button name {"Cancel"})
		if mychoice is not false then
			set theSelection to item 1 of mychoice
			save workspace theSelection
		end if
	end try
end tell

But if the script could know what the currently selected workspace is, this process would be even simpler!

I think I understand your dummy file method of doing this. I wonder if there are any other tricks that can work. For example, since each project already has a tag, could the tag be what is flagged to indicate which workspace is active. Interesting…

its just a quick and dirty job and glad that it might be helpful to u and perhaps others. Post ur modified script when it’s ready. cheers

The challenge is you’d need to constantly rebuild the set of dummy files, to make sure they reflect any new workspaces that have been added. Hmm…

But this is for later. I really should stop this for now, and get back to some paying work!

You could add a shortcut via System Preferences > Keyboard. But suggestions are welcome, it’s not that easy anymore to find a shortcut that doesn’t collide with already used shortcuts, system shortcuts or text editing & emacs shortcuts :slight_smile:

Unfortunately, because the “update” menu item is always different (modified by the name of the active workspace), using System Preferences > Keyboard won’t work.

You’re right of course. Any shortcut suggestions?

I’m partial to shift-cmd-S or option-cmd-S. It feels logical to do cmd-S to save a doc, but Shift-cmd-S to save your ”work instance”.

Both are already used actually (File > Update Indexed Items and Data > Save All)

Drat. Hmm… cmd–option-W then? W for workspace. It’s close to cmd-W to close windows, but that might have some logic to it (cmd-W closes windows, while shift-cmd-W saves them all…)

Is there a full list of taken keys? I couldn’t find one in the manual.

There’s no such list yet but this shortcut might work, thanks.

1 Like

Does workspaces save which groups are open or closed?

No but that’s planned for future releases.

That’s great — when it gets the ability to save open groups, workspaces will become quite a powerful tool!

A problem with a selection/command for workspaces in the sidebar is, in many of my workspaces, the sidebar is hidden out of the way anyway to make room for the plethora of windows I have open…