Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #22336

    Patrick C
    Participant

    I’m trying to write a macro to enable / disable another macro’s “Runs at Events” setting.

    I suspect that this might have something to do with the following key:
    REG_BINARY “CWP”
    in Computer\HKEY_CURRENT_USER\Software\EmSoft\EmEditor v3\Common

    However, accessing a binary key is not possible with GetProfileInt / GetProfileString

    I’d highly appreciate any tips / ideas

    Thanks in advance
    Patrick

    #22337

    Yutaka Emura
    Keymaster

    Hello,

    “CWP” is NOT related to macros.
    Currently, there is no way to enable/disable another macro’s “Runs at Events” settings, unfortunately. I am not sure why you need to enable/disable another macros’ event settings. Maybe, you might want to explain why, and I might think about workarounds.

    Thanks,

    #22346

    Patrick C
    Participant

    Hello Yutaka,

    explain why

    To be honest: Because I’m lazy.
    I’d like to have a Runs at Events on/off button → 1 mouse click required
    Presently it take 4 mouse clicks to turn an event on and off.

    As I have to do this often, it does make a difference

    Regarding priorities:
    I don’t urgently need this – its more like a “very nice to have” convenience feature.

    Thank you for your great support!
    Patrick

    #22414

    LTT
    Participant

    Hello Yutaka,

    Patrick C mentioned the macro I wrote here:
    https://www.emeditor.com/forums/reply/22295/
    https://www.emeditor.com/forums/topic/macro-menu-toggle-runs-at-events-option-for-macros/

    So let me explain further what we need with the reason why I wrote that macro:

    I use some of the event-driven macros not permanently, but momently. When the job is finished, I turn the macro(s) off.
    If one wants to turn such macros on and off quite often, or to switch among them quickly, the “Customize Macros” dialog is inconvenient.
    Moreover, in the dialog, one can not tell the event-driven macros from the others, or tell their status, with a glance.

    So I wrote the macro. It lists only the event-driven macros in a menu. Clicking in the menu toggles the [Runs at Events] option for the relevant macro. Checked or unchecked. Clear and easy.
    The menu is persistent, till the user closes it.

    The macro is not “running a macro within a macro”. It just reads/writes e.g. “Events0” for “Macro0” using GetProfileInt/WriteProfileInt methods.

    It’s really a pity to lose this unique benefit.
    Please consider making a better solution so that users can still achieve it via macros at least.
    Thank you.

    + Further thought:
    Or how about adding a “Run at Events” command in the right-click menu of “My Macros List” menu:
    In “Customize Macros” dialog, we select events for a macro to make it event-driven.
    Then in “My Macros List” menu, we can toggle the [Runs at Events] option for the macro with this command in its right-click menu.
    This command should be designed to only work for the macros that have events.
    And in “My Macros List” menu, such a macro is checked to indicate that it is running at events.
    (But I think my macro is better than this solution.)

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.