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.
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.
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?
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
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…
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
Unfortunately, because the “update” menu item is always different (modified by the name of the active workspace), using System Preferences > Keyboard won’t work.
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.
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…