With new template system, how to insert template into marco?

With new template system, how to insert template into marco?

44
Basic UserBasic User
44

    Mar 26, 2012#1

    Hi all!

    Previously, we could use "Template #" to insert a template into a macro. With the smart template system of UE v18.00, they don't seem to have numbers anymore. So how does this work now?

    Edit: OK, so you can still use the number, i.e. "Template 0" will work. But this brings a different issue: how exactly do you determine the template number given that we can have global templates plus projects templates plus file type specific templates?

    Thanks for any assistance!

    Rob
    :)

    6,675585
    Grand MasterGrand Master
    6,675585

      Mar 26, 2012#2

      Well, nothing changed on the template command for usage in scripts and macros in UltraEdit v18.00. Therefore just the first 50 global templates can be inserted from within a macro / script and those templates should not be templates with variables requiring user input on insert.

      The macro recorder in UE v18.00.0.xxxx does not record inserting a global template by hotkey. This issue was fixed with UE v18.10.0.1010.

      Edit: In UE v18.20 and UES v12.20 the macro and scripting commands collection was extended by commands for inserting any template (global, environment, language and project) by name.

      44
      Basic UserBasic User
      44

        Mar 26, 2012#3

        It's not just global though - it's whatever you have listed in the order seen by the template list. Here is mine:



        I have no global templates. I have some for the environment called "Robs" and some linked to the IDX file type. This macro runs the last one:

        Code: Select all

        InsertMode
        ColumnModeOff
        HexOff
        Template 8
        
        SO... if I open up a HTML file right now and run that macro, it will insert a completely different template! The implication is that unless you define all your templates as global, the "Template #" macro command is unreliable across different environments, file types etc.

        I sent a feature request to see if we can't use something more reliable, perhaps unique template names or something.

        Rob
        :)

        2362
        MasterMaster
        2362

          Mar 26, 2012#4

          This definitely breaks the macro language between versions to some extent, but I believe the trade-off is well worth it to get those smart templates.

          I don't believe the template insert feature is going to be feasible, however, with the smart templates, unless they can also provide a way for you to pass the target values needed for those variable inputs.

          But, in for a penny, in for a pound. Since IDM is moving to a new type of templates, then a new command is needed. I think it should be added as a "new" command to add a "smart template" instead of template. Keep "template" command backwards compatible, and add a new one, to the macro language AND the scripting language, with parameters for target values.

          I've actually never used Template inserts, since I'm only just now starting to use Templates since I upgraded to be able to use Smart Templates.