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

[Q] "Reset Default Workspaces" by scripting?

Contributor ,
Aug 21, 2018 Aug 21, 2018

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)

capture_20180821_125230.png

capture_20180821_125305.png

Thank you,

Naoki

TOPICS
Actions and scripting

Views

893

Translate

Translate

Report

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)

Votes

Translate

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

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)

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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)

Votes

Translate

Translate

Report

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