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

Script to Remove all assigned F keys from a selected Action Set in the Actions Panel

Explorer ,
Dec 17, 2019 Dec 17, 2019

Hello all,

  I am in need of a script that will remove all assigned F keys from a selected Action Set in the Actions Panel. Can this be done? Thank you. 

TOPICS
Actions and scripting
1.2K
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
Adobe
Community Expert ,
Dec 17, 2019 Dec 17, 2019

A script can get all the action sets names loaded  in your actions palette and the name of the actions within the sets.  However, I do not know if a script can see if an actions  has an F key assigned as a short  or assign or un-assign a shortcut.  I would suggest that you install Adobe Scriptlistener Plug-in and see if to records and action manager code when you assign and remove shortcuts for actions.  The script would need to used Action Manager code to do what you want the script to do there isn't any DOM interface to the Actions Palette UI functions. The only DOM method I know of for actions is "doAction"  that plays and action in an action set.

JJMack
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
Explorer ,
Dec 17, 2019 Dec 17, 2019

It did indeed record something. Here it is below:

 

// =======================================================
var idmodalStateChanged = stringIDToTypeID( "modalStateChanged" );
var desc38 = new ActionDescriptor();
var idLvl = charIDToTypeID( "Lvl " );
desc38.putInteger( idLvl, 1 );
var idStte = charIDToTypeID( "Stte" );
var idStte = charIDToTypeID( "Stte" );
var identer = stringIDToTypeID( "enter" );
desc38.putEnumerated( idStte, idStte, identer );
var idkcanDispatchWhileModal = stringIDToTypeID( "kcanDispatchWhileModal" );
desc38.putBoolean( idkcanDispatchWhileModal, true );
executeAction( idmodalStateChanged, desc38, DialogModes.NO );

// =======================================================
var idmodalStateChanged = stringIDToTypeID( "modalStateChanged" );
var desc39 = new ActionDescriptor();
var idLvl = charIDToTypeID( "Lvl " );
desc39.putInteger( idLvl, 0 );
var idStte = charIDToTypeID( "Stte" );
var idStte = charIDToTypeID( "Stte" );
var idexit = stringIDToTypeID( "exit" );
desc39.putEnumerated( idStte, idStte, idexit );
var idkcanDispatchWhileModal = stringIDToTypeID( "kcanDispatchWhileModal" );
desc39.putBoolean( idkcanDispatchWhileModal, true );
executeAction( idmodalStateChanged, desc39, DialogModes.NO );

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
Explorer ,
Dec 17, 2019 Dec 17, 2019

but when turned into its own script and run, it breaks and doesnt do anything. 

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
Community Expert ,
Dec 17, 2019 Dec 17, 2019

The Scriptlistener records some code that is not useful in scripts like "modalStateChanged", it seem to be some code that only works when Photoshop UI is in control of Photoshop. You should look into downloading the Photoshop Clean Scriptlisener script that can delete the garbage code that  the scriptlistener plug-in records that is not useful in Photoshop scripts. Its seems the a script may not be able to do what you want to do. r-bin is a Action Manger Code expert he may be able to answer if what you want scripted can be scripted.

JJMack
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
Explorer ,
Dec 17, 2019 Dec 17, 2019

Thanks, I'll check out the Photoshop Clean Scriptlisener script. 

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
Explorer ,
Dec 17, 2019 Dec 17, 2019

So after cleaning up the script with Clean SL v1.40, it still didn't work. Maybe it can't be done. 

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
Mentor ,
Dec 18, 2019 Dec 18, 2019

The code of the event listener that you brought is not related to managing actions.

 

I think there are 2 options:
a) save the set to disk as atn, load this atn again (at this moment all hotkeys will be automatically reset), delete source set from panel (look sample code and stdlib of xtools, there are examples of each of these actions)
b) create a copy of each action inside the set, delete the original action (in this case, all actions will have a "copy" in the name, but hotkeys will disappear (the event listener can write the duplicate and delete menu commands, they must be applied to each action )

 

I’m sorry that without a code example, I’m not a good programmer to write a working solution in 5 minutes. Nevertheless, I think that both of these scenarios can be implemented.

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
Community Expert ,
Dec 18, 2019 Dec 18, 2019

Xtools may have what you need it has all sorts of scripts that play with action sets, actions and the action palette. You may need to like the append above wrote using  action set atn files you create from the loaded set without the shortcuts keys assigned. then deleting and loading action set in the action palette. There may be no direct way a script can remove a shortcut from an action in the action palette

JJMack
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 ,
Dec 18, 2019 Dec 18, 2019
LATEST

I don't remember where exactly on this forum but I saw the script which showed me what function keys where assigned to actions. That was on Jive forum yet, and r-bin has been involved into that 🙂

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