Welcome Dialog

Welcome to the Community!

We have a brand new look! Take a tour with us and explore the latest updates on Adobe Support Community.


How to determine the name of the active work environment?

Explorer ,
Jun 29, 2021 Jun 29, 2021

Copy link to clipboard

Copied

Hello, I need to write a script that switches 2 working media. For example: if the active working environment has the name "photo", then switch to the working environment "Drawing". Tell me, please, how to determine the name of the active work environment?

TOPICS
Actions and scripting, How to

Views

491

Likes

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 5 Correct answers

Adobe Community Professional , Jun 29, 2021 Jun 29, 2021
you can also use event notifications to track when the workspace is switched and save its name for future use (before first run the code, you need save it to a file, since the event listener will start it every time the workspace is changed) #target photoshop var s2t = stringIDToTypeID, t2s = typeIDToStringID, UUID = 'bf7064f7-eee2-4ac2-a639-5c3832469b43'; try { var target = t2s(arguments[0].getReference(s2t('null')).getDesiredClass()) if (target == 'workspace') { var d ...

Likes

Translate

Translate
Adobe Community Professional , Jun 30, 2021 Jun 30, 2021

Likes

Translate

Translate
Adobe Community Professional , Jun 30, 2021 Jun 30, 2021
var s2t = stringIDToTypeID, UUID = 'bf7064f7-eee2-4ac2-a639-5c3832469b43'; try { var d = app.getCustomOptions(UUID) } catch (e) { } if (d) var w = d.getString(s2t('workspace')) if (w == localize('$$$/FileName/Presets/WorkSpaces/Photography')) { // call function for photography workspace here } else if (w == localize('$$$/FileName/Presets/WorkSpaces/Painting')) { // call function for painting workspace here }

Likes

Translate

Translate
Adobe Community Professional , Jul 01, 2021 Jul 01, 2021
А, блин. Иногда нужно открывать тему по ссылке перед тем как писать То есть примерно так: #target photoshop s2t = stringIDToTypeID; var r = new ActionReference(); r.putProperty(s2t('property'), s2t('menuBarInfo')); r.putEnumerated(s2t('application'), s2t('ordinal'), s2t('targetEnum')); var mainMenu = executeActionGet(r).getObjectValue(s2t('menuBarInfo')).getList(s2t('submenu')) var windowMenu = new ActionDescriptor(), windowTitle = localize('$$$/Menu/Window').replace(/\&/, ''); for (var i...

Likes

Translate

Translate
Adobe Community Professional , Jul 03, 2021 Jul 03, 2021
Если вам нужно срабатывание на строку, которой нет в файле локализации, то уберите в условии функцию localize и сравнивайте непосредственно с нужным вам названием  if (currentWorkspaceTitle == 'Монитор') в случае проблем посмотрите, что пишется в переменную currentWorkspaceTitle в процессе работы скрипта

Likes

Translate

Translate
Adobe Community Professional ,
Jul 03, 2021 Jul 03, 2021

Copy link to clipboard

Copied

Покажите ваш скрипт (код) и имя созданной рабочей среды на кириллице.

Специфичные функции сократите до alert()

 

Likes

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
Adobe Community Professional ,
Jul 03, 2021 Jul 03, 2021

Copy link to clipboard

Copied

del

...

Likes

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
    • 1
    • 2