Menu

notepad.runMenuCommand in Hebrew

Help
Yaron
2014-12-18
2014-12-20
  • Yaron

    Yaron - 2014-12-18

    Hello Dave,

    Thank you for the "Python Script" Plugin. I appreciate your work.

    When Notpad++ Interface Language is set to English, the following script is executed successfully.

    notepad.runMenuCommand("View", "Word wrap")

    However, I couldn't find a way to run that script if the Interface Language is set to Hebrew.
    I've tried various ".decode('utf8')" commands, but to no avail.


    I'd like to write a script executing the following commands:
    1) Plugins -> Compare -> Compare.
    2) View -> Word Wrap.

    notepad.runMenuCommand("Plugins", "Compare", "Compare") does not work even if the Interface Language is English.

    I'd be grateful for your help.

     
  • Dave Brotherstone

    runMenuCommand only ever takes 2 parameters, and they are [parentMenu], [optionName], so in the case of Plugins->Compare->Compare, the parentMenu is "Compare", and the option is "Compare". However, for plugin commands, you're better off using runPluginCommand, as that takes the name of the plugin, and then the option name (in this case the same), but it will be more reliable as only the plugin options are searched rather than the whole menu.

    I've never tried runMenuCommand with the menu in language with characters outside of ISO-8859-1, so it could well be there is an issue there. Can you raise an issue - https://github.com/davegb3/PythonScript/issues

    Thanks
    Dave.

     
  • Yaron

    Yaron - 2014-12-18

    Thank you so much for the immediate reply. It's really kind of you.

    notepad.runPluginCommand("Compare", "Compare")
    notepad.runMenuCommand("View", "Word wrap")

    Works perfectly in English.

    https://github.com/davegb3/PythonScript/issues/20

     
  • Yaron

    Yaron - 2014-12-18

    Hello again,

    Is it possible to run a shortcut?
    - I could assign one to "Word wrap", and use it instead of runMenuCommand.

    I've never used Python before. With your permission, two more questions:

    1) When 2 files are opened side-by-side, one can be set to Direction LTR and the other to Direction RTL.
    How can I change the direction of both files (using a script)?

    Edit:
    Is there a better way than the following lines?

    notepad.runMenuCommand("View", "Text Direction RTL")
    notepad.runMenuCommand("View", "Focus on Another View")
    notepad.runMenuCommand("View", "Text Direction RTL")

    2) I use the following command to open the current file in a maximized Explorer window.

    <Command name="Open Containing Folder..." Ctrl="no" Alt="no" Shift="no" Key="0">"C:\Windows\nircmd.exe" exec max "C:\Windows\Explorer.exe" /select, "$(FULL_CURRENT_PATH)"</Command>

    (http://www.nirsoft.net/utils/nircmd.html).

    Can I achieve that with a script?

    Your help would save me a lot of searching.
    I appreciate your patience.

     

    Last edit: Yaron 2014-12-19
  • Yaron

    Yaron - 2014-12-20

    notepad.menuCommand(MENUCOMMAND.EDIT_LTR)
    notepad.menuCommand(MENUCOMMAND.VIEW_GOTO_ANOTHER_VIEW)

    Works even if the Interface Language is set to Hebrew.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.