DOWNLOAD Macro File:
Zabobon's Dynamic Workspaces v6.01 Macros.kmmacros (496.6 KB)
Save and Restore Workspaces (Positions/Sizes of Windows for Finder Folders, Applications and Webpages).
During the last couple of years, I had many online meetings where I arranged several Finder Windows and Apps on my monitors and had certain Webpages open. At the end of the meeting those Windows got moved and closed and I wanted a way to restore my nicely arranged Workspace the next time I had a similar meeting.
Tested with Keyboard Maestro 10.2 and macOS Ventura 13.2.1 (Note - these Macros need Keyboard Maestro 10 or above to run.)
(Detailed Instructions and Version Notes are in the ReadMe file. And there is a Help button available when the Macro is running.)
Instructions
ยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยท
UPGRADE INSTRUCTIONS:
Disable (or Delete) any previous Zabobon's Dynamic Workspaces Macro Group. Probably a good idea to just Disable the old Group at first in case you prefer it to the new version.
NOTE: I have done my best to make this version backwards compatible with previous versions - however as previous versions only allowed saving of one instance of a Safari or Chrome Window it is possible that some saved Workspaces might have to be manually recreated.
ยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยท
SET UP:
The Macro Group will come in disabled so, you will need to enable it to work.
Change the Trigger Shortcuts for the 2 Macros to what you would like. I have them as:
โโS Save to Workspace
โโR Restore Workspace
There are other items in the Group: A ReadMe and several Subroutines that are called by the main 2 Macros.
ยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยท
HOW TO USE:
Saving Window Positions to a Workspace
Position and size up to 8 open Applications and Finder Windows in a way that works well for a task. Additionaly, open any URL in Safari or Chrome Website Windows and position them too (note that this Macro saves individual Window Postions - it ignore Tabs).
Once all are nicely positioned, click on the first Window that you want to save the Position/Size/Path/URL and run the Save to Workspace Macro. I have the shortcut as โโS
A Dialog will pop up showing the currently selected Workspace to Save To. On first run this will be the generically named, "Workspace A".
Press OK (or hit Return) to Save the currently selected Window to the Workspace. A Confirmation Dialog will pop up (and close automatically after a few seconds - no need to hit Return again).
Click on the next Window that you have positioned nicely and again press โโS followed by Return to Save it to the currently selected Workspace. The whole process is very quick.
Click the "Workspace" button to choose a different Workspace or just to view all saved Workspaces. Select a Workspace from the list and either double-click or press Return to select it. Click away from the panel or press Esc to close it.
Click the "Options" button for other options such as adding/deleting/renaming Workspaces.
Up to 8 Windows can be saved for each Workspace. If an existing Application or Finder Window is resaved only the latest Position/Size/Path/URL is included in the Workspace. Multiple instances of Finder Windows, Safari Windows and Chrome Windows can be saved in each Workspace.
If at a future date, you want to modify the Saved Position/Size/Path/URL of any particular Window in a Workspace, just makes sure it is the frontmost Window on the Desktop and again press โโS followed by Return to overwrite its previously saved postion.
Restoring Workspaces
To Restore a Workspace, run Restore Workspace โโR
Press OK (or hit Return) to Restore the currently selected Workspace (all windows will be Restored to their Saved Positions, Finder Folders Saved will be Reopened and URLs will be Restored for Safari and Chrome).
Click the "Workspace" button to choose a different Workspace to Restore.
Click the "Options" button for other options such as adding/deleting/renaming Workspaces.
NOTES:
If Any Window does not Restore as expected
If any Workspace does not initially restore as expected, run Restore โโR a second time. That will usualy do it (it might be that a non-running Application took longer than the set timeout time of 5 seconds to open up again). It most often works first time - but this is the fix if it doesn't.
Finder Folders
Multiple Finder Folders can be Saved in any one Workspace.
Folders will remember their Path and automatically re-open (even if that particular Folder has been closed in the meantime).
Web Pages from Safari and Google Chrome
The current URL in Safari or Chrome will be Saved and Recalled. I have found this to be useful in repeat meetings.
Workspace Names
If Workspaces are deleted their data is not actually lost. Simply their name is not listed. If you add the same Workspace name in the future, its window data will still be there.
Applications
Application Windows don't remember any particular file. The reasoning being that each time an Application (e.g. QuickTime) is used in a Workspace it will probably be with a different document open and it would be annoying if it kept reverting back to the document that was open at the time the Workspace was Saved. Only one instance of an Application can be Saved in each Workspace.
If the Keyboard Maestro Library is synced across multiple Macs, one benefit of the fact that Keyboard Maestro does not sync Variables & Dictionaries is that the Workspaces will be unique to each Mac.
Extended Desktops over multiple Monitors
A Workspace can have Windows arranged over multiple Monitors.
Tabs
Only Window Positions are Saved, Tabs are ignored.
Number of Workspaces and Windows (Slots)
There can be an infinate number of Workspaces but each Workspace is limited to saving a maximum of 8 Windows. If every single Workspace is deleted the generic Workspaces A, B, C are recreated.
ยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยท
Version History, click to expand
Version: 6.01
โข Bug fixes (Safari and Chrome Windows not saving correctly) and interface change.
Version: 5.02
โข Switched over to using Keyboard Maestro 10 Subroutines Actions to make it easier for me to maintian the Macros going foward.
โข Removed Option to overwrite Finder Windows if they are in an identical position to a previously saved Finder Window to simplify usage.
โข Removed Option to Restore just one Window in a Workspace to simplify usage.
Version: 4.09
โข Fix for AppleScript bug in macOS 12.3 which broke Keyboard Maestro's Open with Finder Action.
Version: 4.06
โข Corrected typo of "minimized"
โข Added Checkbox in the Save Workspace Prompt, to overwrite Finder Windows if they are in an identical position to a previously saved Finder Window in that Workspace.
Version: 4.05
โข Interface Changes.
Version: 4.04
โข Interface Changes.
Version: 4.03
โข Replaced my Progress Bar with KM10 inbuilt Progress Bar.
โข Added option to restore a single Window from the selected Workspace.
โข Added an Option to Minimize other Finder Windows before Restoring Workspace.
โข Interface Change for Previewing of Workspaces.
Version: 3.12 2021-11-02
โข Fixed huge bug in previous version that broke Options.
Version: 3.11 2021-10-17
โข Interface changes to the User Prompts to clarify when a Workspaces will be Restored and when it will be Previewed.
โข Removed Auto-Postioning of User Prompts.
Version: 3.10
โข Minor Interface change.
Version: 3.09
โข Should work correctly on Mac Systems that are not set up with the language as English. (Before, a few of the pauses waited for certain menu items to appear and if those menu items were not in English, the Macro would pause forever).
Version: 3.08
โข Added Help Button with Instructions
Version: 3.06
โข Prompts now centre on screen
Version: 3.04
โข More work on the Interface and fixed typos
โข Added option to put Workspaces into A-Z order
Version: 2.96
โข Added option to rename Workspaces
โข Bug fixes
โข Still more simplification of the Interface...
Version: 2.89
โข A few interface changes and a couple of bugs squashed.
Version: 2.83
โข Changed to allow an unlimited number of Workspaces.
โข Changed to allow saving of multiple Safari or Chrome Webpages in each Workspace.
โข Added Macro, "Workspaces Options..."
โข Tried to simplify the interface, whilst adding more options.
โข Reworked the Progress Bar to stop it vanishing and reappearing in a long Restore.
Version: 2.25 2021-07-26
โข Increased number of possible saved Workspaces from 6 to 12
โข If a single Workspace Name is edited, it becomes the chosen workspace (in previous versions it had to be selected again from the the dropdown list after editing which was a bit clunky)
Version: 2.23 2021-07-11
โขAdded shortcut keys to the Dialog Buttons - Cancel (shortcut Esc), Edit (shortcut E), Clear Slots (shortcut C)
Version: 2.22 2021-06-25
โข Simplified the Clear Workspaces Macro.
โข Bug fix (removed delay at the end of the Progress Bar).
โข Tidied up the display of restoring Webpages on the Progress Bar.
Version: 2.21 2021-06-24
โข Added a Progress Bar to give live feedback on the Windows being Restored.
โข The Progress Bar lists each Window in the Workspace as the Macro Restores and also lists any Webpages that are associated with the Workspace.
Version: 2.191 2021-06-21
โข Bug fix
Version: 2.19 2021-06-18
โข All saved Data from v2.17 onwards will always remain in Dictionaries so, downloading this new version will not mess up any Workspaces you might have saved.
โข Some interface tidying up to make things clearer.
โข Reduced timeout on Pause for Applications to open fully from 1 minute to 5 seconds as I was finding Zoom restoring caused the Macro to pause for the full 1 minute every time.
โข Removed the separate Macro "Edit Workspaces" and made it a part of the other three Macros.
โข Added the option to Clear Slots.
Version: 2.17 21-06-11
โข Stable Version allowing Multiple Workspaces to be Saved and Restored.
โข Data now mostly Saved in Dictionaries.