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

How to add a custom section to the settings menu?

Explorer ,
Jul 11, 2017 Jul 11, 2017

Copy link to clipboard

Copied

For my ever-growing set of scripts customization options are starting to become necessary. Is there any way to create a new section in the settings menu or do I have to create my own Window for this?

TOPICS
Scripting

Views

547

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
Community Expert ,
Jul 12, 2017 Jul 12, 2017

Copy link to clipboard

Copied

Hi Tobias,

are you talking about organizing script files in your Scripts Panel? That's doable.
You could use folder structures and alias files for folders or script files.

For example: You could start with a folder somewhere on your harddisk and do an alias from it.
Duplicate that alias to your personal Scripts folder in your User folder.

In the original main folder you can add and remove alias files, alias folders or whole file-folder structures that alias to other folders of your harddisk. Depending on the amount of files InDesign will (nearly) immediately show the updated contents in the Scripts Panel.

With my own workflow on OS X I am using a main alias with a folder. And I am using duplicates of that alias with several versions of InDesign installed. I will move this alias out and in of the Scripts Panel folder in my User folder.
One application of this: Sometimes I have to do a list of all keyboard shortcuts. This could be a time consuming process because InDesign will also list every file that is visible in the Scripts Panel.

I will do a similar process if I gather a bunch of scripts for a dedicated job with a customer.

Or if I need a set of scripts for a special workflow. Let's say working with tables or working with MSOs.

Alternatives?

Harbs from in-tools once wrote a script for installing scripts:

Script Installation | in-tools.com

And there is ScriptBay as well ( not for CC 2017 because it's a Flash based panel. Maybe some issues to install it with CC 2015 because of an installer problem that is enforced by the Adobe Application Manager 😞

Script Bay Update | in-tools.com

Regards,
Uwe

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
Explorer ,
Jul 12, 2017 Jul 12, 2017

Copy link to clipboard

Copied

Hi Uwe,

thanks for your reply. But what I'm talking about is the Preferences menu (sorry, I mistranslated from German).

maxresdefault.jpg

I would like to have another entry at the bottom which upon selection makes the right pane show the configuration for my scripts.

Cheers,

Tobias

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
Guide ,
Jul 12, 2017 Jul 12, 2017

Copy link to clipboard

Copied

Hi,

I think that you can only add to that window through a C++ plugin.

P.

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
Guide ,
Jul 12, 2017 Jul 12, 2017

Copy link to clipboard

Copied

Adding the menu item works, but for the selectable dialog you indeed need a plugin.

I'd suggest to add a separate menu for your preferences and create a similar dialog using ScriptUI.

I found the prefs menu within the AppleMenu, your mileage may vary with Windows, InCopy and who knows, so tweak the search to your needs. Btw, to plugins the prefs menu is a sub-menu of the edit menu, that's why I started there.

#targetengine "test"

  var actionName = "Action!";

  var hereName = "Here!";

  var mainMenu = app.menus.itemByName("$ID/Main");

  var appleMenu = mainMenu.submenus.itemByName("$ID/AppleMenu");

  var editMenu = mainMenu.submenus.itemByName("$ID/&Edit");

  var prefsMenu = mainMenu.submenus.itemByName("$ID/Preferences");

  if( !prefsMenu.isValid )

    prefsMenu = editMenu.submenus.itemByName("$ID/Preferences");

  if( !prefsMenu.isValid && appleMenu.isValid )

    prefsMenu = appleMenu.submenus.itemByName("$ID/Preferences");

  var hereMenu = prefsMenu.parent.submenus.itemByName(hereName);

  if( !hereMenu.isValid )

    hereMenu = prefsMenu.parent.submenus.add(hereName,LocationOptions.AFTER,prefsMenu);

  var action = app.scriptMenuActions.itemByName(actionName);

  if( action.isValid )

    action.remove();

  action = app.scriptMenuActions.add({name:actionName});

//~ action.eventListeners.add("beforeDisplay",display,false);

  action.eventListeners.add("onInvoke",invoke,false);

  var menuItem = prefsMenu.menuItems.itemByName(actionName);

  if( menuItem.isValid )

    menuItem.remove();

  menuItem = prefsMenu.menuItems.add(action,LocationOptions.AT_END,null);

  var menuItem = hereMenu.menuItems.itemByName(actionName);

  if( menuItem.isValid )

    menuItem.remove();

  menuItem = hereMenu.menuItems.add(action,LocationOptions.AT_END,null);

function invoke(e)

{

  alert(e.target.name);

}

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
Explorer ,
Jul 13, 2017 Jul 13, 2017

Copy link to clipboard

Copied

LATEST

Thank you, Dirk. Seems like that is as far as scripting can go

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