Copy link to clipboard
Copied
Hi all,
Is there way to do "Reset Default Workspaces" by scripting (or progmatically)?
First preference is by ExtendScript.
Alternatively, out side of Photoshop app. Ex) delete file or edit registry.
Purpose is for preparing before and clean up after automated unit test.
My understanding is there is 2 way to do on UI.
1) Menu: Edit -> Preferences -> Workspace -> Restore Default Workspaces
2) Menu: Window -> Workspace -> Reset Essentials (Default)
Thank you,
Naoki
function sTT(v) {return stringIDToTypeID(v)}
(ref = new ActionReference()).putName
(sTT('workspace'), 'Essentials');
(dsc = new ActionDescriptor())
.putReference(sTT('null'), ref)
executeAction(sTT('reset'), dsc)
Copy link to clipboard
Copied
function sTT(v) {return stringIDToTypeID(v)}
(ref = new ActionReference()).putName
(sTT('workspace'), 'Essentials');
(dsc = new ActionDescriptor())
.putReference(sTT('null'), ref)
executeAction(sTT('reset'), dsc)
Copy link to clipboard
Copied
Thank you very much for the code.
It works perfectly.
One thing I missed in the question was I needed to select 'Essentials' workspace before reset.
Following code was added selection code for someone's help.
function sTT(v) {
return stringIDToTypeID(v)
}
(ref = new ActionReference()).putName (sTT('workspace'), 'Essentials');
(dsc = new ActionDescriptor()).putReference(sTT('null'), ref);
executeAction(sTT('select'), dsc);
executeAction(sTT('reset'), dsc);
Thank you very much,
Naoki
Copy link to clipboard
Copied
I actually predicted that you can meet problem when this workspace is not chosen but it seems you were smart to find it Remember also when it is chosen and you reset it, it is not completetly same workspace as it does not choose "Move Tool".
function sTT(v) {return stringIDToTypeID(v)}
(ref = new ActionReference()).putName
(sTT('workspace'), 'Essentials');
(dsc = new ActionDescriptor())
.putReference(sTT('null'), ref)
executeAction(sTT('select'), dsc)