Fighting with selection in macros

Fighting with selection in macros

9

    Jan 13, 2007#1

    Hi, i'm trying following code in UE 12.20b without luck.
    The goal with my macro is to isolate the filename or in other words to delete drive\path

    input:
    some text "F:\Projects\Long_hole.ide"

    Wanted macro output:
    some text "Long_hole.ide"

    Here is the macro:
    InsertMode
    ColumnModeOff
    HexOff
    PerlReOn
    Key END
    Find Up "\"
    StartSelect
    Find Up "F:"
    EndSelect

    I can see that the curser for nano-seconds passes "\" and then stays by "F", however nothing is selected :(
    I guess that this is some of the already diskussed "wait for timing" issues with UE.
    If i'm wrong here, I would be very happy with some tips :-)

    If I in any way can do the same from the userinterface, I could solve my task with Macro Express ( http://www.macros.com/ )
    However UE doesn't accept shift down with CRTL-F3 :(

    regards Lars

    6,602548
    Grand MasterGrand Master
    6,602548

      Jan 13, 2007#2

      The solution is to use following: Find Up Select "F:"

      You can use the "Find with selection feature" only when holding SHIFT key when pressing the button Find Next in the Find dialog as described in help about Find command. But it cannot be used with CTRL+SHIFT+F3.

      In such cases where only the file name is needed it is best not to use CopyFilePath with a following Paste and some code to delete the path.

      Easier is to create ONCE a template with content [FILE_NAME][FILE_EXTENSION] and use the macro command Template x to insert the current file name with extension only.

      See for example How to Add the time and date automatically to log files how to create a template.
      Best regards from an UC/UE/UES for Windows user from Austria

      9

        Jan 14, 2007#3

        Hi Mofi, thanks again I solved my task, with help from your tip :-)
        regards Lars