Create a new Macro based on a template

Hi,

I'm having a working solution to add one by one all the state/provinces into a configuration page. Now I'm wondering if it's possible to create a macro where the user is asked to insert or paste a list with all the states/provinces and the corresponding iso code of that state/province and that this macro will create a new macro based on a template. So for example the Netherlands has a list of 12 provinces:

Province ISO
Drenthe DR
Flevoland FL
Friesland FR
Gelderland GE
Groningen GR
Limburg LI
Noord-Brabant NB
Noord-Holland NH
Overijssel OV
Utrecht UT
Zeeland ZE
Zuid-Holland ZH

Now I want to create a macro that can loop over this list (12 provinces) and then add the province in the first insert text element and the iso code in the second. So it will create 12 of these grouped actions.

Add States.kmmacros (8.8 KB)

Is this possible?

Thanks!

Juul

You could. But you should probably not.

Better would be to make this macro a Subroutine trigger, and then use the Execute a Subroutine action to select the desired text.

And unless there is a really good reason you want all of them to be macros, better would be to store the data and then execute a single macro and specify the desired entry you want and have that data looked up and execute the macro (in which case you probably don't even need the subroutine, because it'll all be a single macro).

I guess really I would step back a bit and say: Why do you want to create hundreds (thousands?) of macros, one for each state in each country? What are you really trying to do?

@peternlewis quite logical :blush: I'll try to put it in a single macro and prompt for a list of the states/provinces and loop over them. Thanks for pointing me in this direction :smiley:

1 Like