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

Help with writing and playing macros

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

Postby StaticGhost » Sun Mar 25, 2012 8:40 pm

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
:)
User avatar
StaticGhost
Basic User
Basic User
 
Posts: 35
Joined: Sun Nov 21, 2004 12:00 am

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

Postby Mofi » Mon Mar 26, 2012 12:31 am

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.
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 3936
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna

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

Postby StaticGhost » Mon Mar 26, 2012 12:58 am

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

Image

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
:)
User avatar
StaticGhost
Basic User
Basic User
 
Posts: 35
Joined: Sun Nov 21, 2004 12:00 am

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

Postby rhapdog » Mon Mar 26, 2012 5:36 am

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.
User avatar
rhapdog
Master
Master
 
Posts: 253
Joined: Tue Apr 01, 2008 10:02 am
Location: Mississippi, USA


Return to Macros

cron