Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

[Q] "Reset Default Workspaces" by scripting?

Contributor ,
Aug 21, 2018 Aug 21, 2018

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)

capture_20180821_125230.png

capture_20180821_125305.png

Thank you,

Naoki

TOPICS
Actions and scripting
1.1K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Aug 21, 2018 Aug 21, 2018

function sTT(v) {return stringIDToTypeID(v)}

(ref = new ActionReference()).putName

(sTT('workspace'), 'Essentials');

(dsc = new ActionDescriptor())

.putReference(sTT('null'), ref)

executeAction(sTT('reset'), dsc)

Translate
Adobe
LEGEND ,
Aug 21, 2018 Aug 21, 2018

function sTT(v) {return stringIDToTypeID(v)}

(ref = new ActionReference()).putName

(sTT('workspace'), 'Essentials');

(dsc = new ActionDescriptor())

.putReference(sTT('null'), ref)

executeAction(sTT('reset'), dsc)

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Aug 21, 2018 Aug 21, 2018

Kukurykus

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 21, 2018 Aug 21, 2018
LATEST

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)

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines