Skip to main content
Frans v.d. Geest
Community Expert
Community Expert
December 20, 2022
Answered

SCRIPTING: Startup script to Force reset (current named) Workspace at Startup

  • December 20, 2022
  • 1 reply
  • 1666 views

Many problems with more than one display and m1 Macs with sleep, wake restart etc. where InDesign 18.1 'forgets' the second display so I have to rest my workspace again to show all panel.

Is there a startup(!) script that can Reset (name of my workspac) Workspace at Startup of InDesign?

Reset, not 'load'!

(Using Dutch version!)

Thanks in advance!

This topic has been closed for replies.
Correct answer rob day

Hi Frans, I have not upgraded to 2023, but this works in 2021 from Applications⁩ ▸ ⁨Adobe InDesign 2021⁩ ▸ ⁨Scripts⁩ ▸ ⁨startup scripts⁩:

 

 

#targetengine "session"

app.eventListeners.add("afterActivate", setWorkspace);

function setWorkspace(e){
    var menuItem =  app.menuActions.itemByID(91219)
    if(menuItem.enabled){  
        menuItem.invoke();  
    };  
    app.removeEventListener("afterActivate", setWorkspace);
}

 

1 reply

rob day
Community Expert
rob dayCommunity ExpertCorrect answer
Community Expert
December 20, 2022

Hi Frans, I have not upgraded to 2023, but this works in 2021 from Applications⁩ ▸ ⁨Adobe InDesign 2021⁩ ▸ ⁨Scripts⁩ ▸ ⁨startup scripts⁩:

 

 

#targetengine "session"

app.eventListeners.add("afterActivate", setWorkspace);

function setWorkspace(e){
    var menuItem =  app.menuActions.itemByID(91219)
    if(menuItem.enabled){  
        menuItem.invoke();  
    };  
    app.removeEventListener("afterActivate", setWorkspace);
}

 

Frans v.d. Geest
Community Expert
Community Expert
December 21, 2022

Hi Rob,

great thanks! Do I need to insert the name of the current workspace to be reset anywhere in the script? I don't believe so this way, but I'm no scripter 😉

rob day
Community Expert
Community Expert
December 21, 2022

No it’s the same as choosing the Reset (ws name) menu item. There is an app.applyWorkspace(“Name”) method if you wanted to switch workspaces.