Script for deleting from cursor position in a segment?

Dear colleagues,

I have been using the following script to delete all text from cursor position in a target segment, but all of a sudden it's no longer working (maybe a conflict in key assignment after installing new programs on my computer?)  Can someone help me tweak this script to make it work again?  I just took a quick look at Studio 2017's shortcuts and only see a shortcut for clear target text, not exactly what I was looking for.

Thank you!

Chunyi

 

^D:: ; Delete to end of segment
 sendinput, +^{PgDn}
 sendinput, {Delete}
 sleep, 100
 sendinput, {Esc}
 return 

Parents
  • Hi Chunyi,

    A few things:

    - Your script works for me, but I'd try inserting a Sleep 100 between the first 2 SendInputs.

    - Sending an escape character does nothing in Studio... I'd delete that line.

    - There is already a shortcut in Studio that deletes from cursor to the end of segment (and it's CTRL+d by default; in English it says Delete to end of row, check it, please). If you use the same default Studio shorcut as an AutoHotkey hotkey, then your AutoHotkey script should run fine anyway.

    - Check that your script is running (little green  icon in the Windows tray system). Any other color or letter means your script is suspended or paused.

     

    I'd try with this:

    ^d:: ; Delete to end of segment
    sendinput, +^{PgDn}
    sleep, 100
    sendinput, {Delete}

    return

    Good luck!

    … Jesús Prieto …

Reply
  • Hi Chunyi,

    A few things:

    - Your script works for me, but I'd try inserting a Sleep 100 between the first 2 SendInputs.

    - Sending an escape character does nothing in Studio... I'd delete that line.

    - There is already a shortcut in Studio that deletes from cursor to the end of segment (and it's CTRL+d by default; in English it says Delete to end of row, check it, please). If you use the same default Studio shorcut as an AutoHotkey hotkey, then your AutoHotkey script should run fine anyway.

    - Check that your script is running (little green  icon in the Windows tray system). Any other color or letter means your script is suspended or paused.

     

    I'd try with this:

    ^d:: ; Delete to end of segment
    sendinput, +^{PgDn}
    sleep, 100
    sendinput, {Delete}

    return

    Good luck!

    … Jesús Prieto …

Children