Skip to main content
Inspiring
June 19, 2024
Answered

item.menuID for the EDIT dropdown Menu?

  • June 19, 2024
  • 1 reply
  • 385 views

The following post shows how to activate items in the PLUGINS drop down menu of Photoshop using UXP.

 

https://forums.creativeclouddeveloper.com/t/question-about-migrating-cep-plugin-to-uxp/3974/5

 

It includes the line

const plugins = menuBar.submenu.find(item => item.menuID === 7200)

My question is ....  what is the item.menuID number for the EDIT drop down menu?

 

The context here is that ‘Undo’ is an item in the Edit drop down menu which I wish to address. Currently, I have written a plugin where users can hit ‘Undo’ (say) 6 times if they don’t like the outcome and want to revert to the original state.   I would like to provide a button which the user can click in order to automatically instigate 6 'undos'.

This topic has been closed for replies.
Correct answer terence21981657g3ek

Following some guidance from ChatGTP, I have written a program that can answer my question.

 

The values of item.menuID are as follows

 

 

Menu Item: &Help,   ID: 1

Menu Item: &File, ID: 2

Menu Item: &Edit, ID: 3

Menu Item: &Layer, ID: 4

Menu Item: T&ype, ID: 23

Menu Item: &Select, ID: 7

Menu Item: Fil&ter, ID: 6

Menu Item: &View, ID: 9

Menu Item: Plugins, ID: 7200

Menu Item: &Window, ID: 8

 

 

This doesn’t make complete sense but blame Adobe not me!

It seems that the methodology here.

https://forums.creativeclouddeveloper.com/t/question-about-migrating-cep-plugin-to-uxp/3974/5

Only works for static menu items and not for dynamic menu items.

 

An example of a dynamic menu item is the 'Undo item'

This might read

‘Undo Rasterise Style’

But if you activate this then it might then read

‘Undo layer Style.’

 

My original objective to implement 6 Undos in UXP can be achieved by the following command.

 

        // Select history state -6

        {"_obj":"select","_target":[{"_offset":-6,"_ref":"historyState"}]}

1 reply

terence21981657g3ekAuthorCorrect answer
Inspiring
July 17, 2024

Following some guidance from ChatGTP, I have written a program that can answer my question.

 

The values of item.menuID are as follows

 

 

Menu Item: &Help,   ID: 1

Menu Item: &File, ID: 2

Menu Item: &Edit, ID: 3

Menu Item: &Layer, ID: 4

Menu Item: T&ype, ID: 23

Menu Item: &Select, ID: 7

Menu Item: Fil&ter, ID: 6

Menu Item: &View, ID: 9

Menu Item: Plugins, ID: 7200

Menu Item: &Window, ID: 8

 

 

This doesn’t make complete sense but blame Adobe not me!

It seems that the methodology here.

https://forums.creativeclouddeveloper.com/t/question-about-migrating-cep-plugin-to-uxp/3974/5

Only works for static menu items and not for dynamic menu items.

 

An example of a dynamic menu item is the 'Undo item'

This might read

‘Undo Rasterise Style’

But if you activate this then it might then read

‘Undo layer Style.’

 

My original objective to implement 6 Undos in UXP can be achieved by the following command.

 

        // Select history state -6

        {"_obj":"select","_target":[{"_offset":-6,"_ref":"historyState"}]}

kglad
Community Expert
Community Expert
August 26, 2024

i don't see any problem here.