-
-
Notifications
You must be signed in to change notification settings - Fork 242
-
How can I move menu items that are not in the menus_id and whose names do not contain menus_name to more_options ? Just like the code I wrote, but it's completely useless
$menus_id = this.id(
id.new,
id.refresh,
id.undo,
id.redo,
id.delete,
id.properties,
id.open,
id.open_with,
id.run_as_administrator
)
$menus_name = ["zip", "Word", "Excel"]
modify(mode=mode.multiple where=(!menus_id || !str.contains(this.name, menus_name)) menu=title.more_options)
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 1 comment 7 replies
-
at first glance the logic is not correct:
not(menus_id or contains(this.name, menus_name) or !menus_id and !str.contains(this.name, menus_name)
the usage of !, &&, || is correct
Beta Was this translation helpful? Give feedback.
All reactions
-
In "str.contains", I can achieve this with just one string.
There are many menu items that I want to keep in the main course item and move all the other menu items into more options, but this seems unfeasible. I don't know what other way I can realize my idea.
In addition, using "cmd=io.dir.create('C:\temp')" and "cmd=io.delete('C:\temp')" cannot achieve the creation and deletion of folders in the C drive
modify(mode=mode.multiple where=!menus_id and !str.contains(this.name, "zip") menu=title.more_options)
Beta Was this translation helpful? Give feedback.
All reactions
-
modify(where=len(regex.matches(this.name, '(cut|opy|past|del)'))>0 vis=2)
... and io.dir.create() does not work on restricted paths - use cmd command with admin.
Several people have complained about the same thing recently - maybe Microsoft has changed the way an API works that this function uses. I can make command with "some complex logic" where if io.dir.create fails then the cmd command is called - that way it doesn't have to bring up an admin prompt where it's not necessary, but I don't know if it's worth it.
Beta Was this translation helpful? Give feedback.
All reactions
-
Thank you for your answer, which has solved my difficulty. However, I have a new problem. The right-click menu item of my notepad++ software has turned gray and cannot be clicked. How can I solve this?
Beta Was this translation helpful? Give feedback.
All reactions
-
modify(find='Edit with Notepad++' vis=vis.remove)
Beta Was this translation helpful? Give feedback.
All reactions
-
Thanks
Beta Was this translation helpful? Give feedback.