Need help creating macro plz.

Home Forums Multi-Edit User Created Macros Need help creating macro plz.

This topic contains 2 replies, has 2 voices, and was last updated by  Clay Martin 4 months, 1 week ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #23726

    CharlesG
    Participant

    I would like help creating a macro that would:

    – make the window that has “C:\Lists\TCMD_List.txt” the current window

    – go to the line number that is currently in the windows clipboard

    – Macro Home /T=500

    – Macro ShiftCursor

    – Macro CutPlus /M=1

    – make the window that has “C:\Lists\bad_names.txt” current

    – go to EOF, If line is not blank, go down one line….

    – macro PastePlus

    – switch back to “C:\Lists\TCMD_List.txt” window

    – Macro Exit /NP=1

    #23727

    CharlesG
    Participant

    I have a line number in the windows clipboard. How would I get that and pass it to

    Goto_line();

    I think it might involve Win3_Paste but am unclear how?

    #23731

    Clay Martin
    Keymaster

    Hi,
    I’ll attack the line number question at a high level if you have further questions let me know.
    1- get and save the window id (with Window_ID) of the file C:\Lists\TCMD_List.txt after you open it, ld_files will open it, same with C:\Lists\bad_names.txt)
    1.1- You need to open a new window, in nondisplay mode (just change the Display value to 0 or use Make_Window_Visible) and use Create_window
    2- Get the window id and save it in a variable with Window_ID
    3- Use Paste (see Paste in paste.s) and use the parm to do the paste from the windows clipboard
    4- switch to the window you created (using window id) do a tof to get the cursor to the top of the window you created
    5- use Get-Word to grab the line number into a variable
    5.1- delete that window
    6- Swich to window that holds C:\Lists\TCMD_List.txt use Goto_line with that variable to go to the line
    7- – Macro Home /T=500
    – Macro ShiftCursor
    – Macro CutPlus /M=1
    8- switch to window with C:\Lists\bad_names.txt by window id
    9 – – go to EOF, If line is not blank, go down one line….
    – macro PastePlus
    – switch back to “C:\Lists\TCMD_List.txt” window
    – Macro Exit /NP=1

    Hope this helps
    Clay

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

You must be logged in to reply to this topic.