Just want to make sure that I’m not misleading you. The added lines just change the name of the dummy to reflect which workspace has been loaded coz you mentioned that you forget which workspace is loaded sometimes.
No, the dummy doesn’t need to be in favourites. Just that I thought you may want to see that right in the sidebar. It is one possible idea and there is no need to waste too much time on it…
No, I get it. It’s using the dummy file as a way to store the currently active workspace. I just made the following script to update the current workspace.It looks up your dummy file, trims out the name of the workspace from it, and saves the current workspace to it.
tell application id "DNtp"
try
--change uuid to the item link of your dummy file
set wsFlag to get record with uuid "043DA815-DB89-46D5-A0B7-D403D724365E"
--assumes the name of this file is "*workspace: " + the workspace name
set wsName to the name of wsFlag as text
set wsName to ((characters 13 thru -1 of wsName) as string)
save workspace wsName
beep
end try
end tell
I’m not a fan of using “characters 13 thru -1” to strip out the prefix, but I couldn’t find a simple command to remove a substring. Anyone have a suggestion for how remove a substring (e.g. "*workspace: ") from a longer string (e.g. “*workspace: savedname”)?
@dansroka By chance, do you know if it’s possible to limit the windows that DEVONthink saves for a given workspace? For example, is it possible to only save the frontmost window or those on your current desktop/space?
Like yourself, I use a lot of workspaces (and use a similar script, which I feed into Alfred to make the selection and saving of workspaces a little easier). At any given time, I usually have a few different workspaces open - which makes updating them tricky (i.e., because it requires opening a closing the windows that aren’t associated with a particular workspace). In any case, given your use of workspaces, I just thought you might have a trick for this. Thanks for your help!
I tried workspaces several times but there must be something wrong with them in the current state, at least for me. Would really like to make use of them.
BTW is there a reason that the dictionary is missing a property that returns the current workspace?
Not sure, maybe accessibility. But with a “current workspace” property it will be possible to write a script and assign a shortcut. I prefer spending some time to set things up and afterwards never think about them again rather than digging around in menus
hey @dansroka I know this is an old thread but this is exactly what I needed! Thanks so much. I put these two in the script toolbar folder, adding icons to the files so they show up nice on the toolbar. Such a tidy easy workflow now
Ive added a couple of screenshots in case other newbs like me come along wanting this kind of thing and dont quite know how to do it. Point me at other script tips if you feel the need. x