Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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 );
Copy link to clipboard
Copied
but when turned into its own script and run, it breaks and doesnt do anything.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
Thanks, I'll check out the Photoshop Clean Scriptlisener script.
Copy link to clipboard
Copied
So after cleaning up the script with Clean SL v1.40, it still didn't work. Maybe it can't be done.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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 🙂
Find more inspiration, events, and resources on the new Adobe Community
Explore Now