Jump to content


Photo

How to set macro to repeat X number of times


  • Please log in to reply
2 replies to this topic

#1 nuggles

nuggles

    Newbie

  • Members
  • Pip
  • 17 posts

Posted 01 February 2009 - 05:32 PM

hello everyone,

i have a macro that i would like to automatically repeat itself upon comletion of its duties. is there an option in the editor that i am missing for this?
ideally i would like to be able to set it once, for example, to repeat 10 times. from then on whenever i activate, it will repeat 10 times

on a separate note, i suppose it might also prove useful, when implemented, to be prompted upon activation for how many times if any, i want my macro to repeat

much thanks

#2 terrypin

terrypin

    Master

  • Members
  • PipPipPipPipPipPipPip
  • 1,485 posts

Posted 01 February 2009 - 05:50 PM

hello everyone,

i have a macro that i would like to automatically repeat itself upon comletion of its duties. is there an option in the editor that i am missing for this?
ideally i would like to be able to set it once, for example, to repeat 10 times. from then on whenever i activate, it will repeat 10 times

on a separate note, i suppose it might also prove useful, when implemented, to be prompted upon activation for how many times if any, i want my macro to repeat

much thanks


Just place your macro inside a Repeat loop.

Unfortunately, due to the bug I reported in this thread, you can't prompt in the obvious way at present, in a Repeat Start command. Pending the fix, you could do it with an extra command like this:

Variable Set Integer %N[1]%: Prompt
Repeat Start (Repeat %N[1]% times)
// Place your Macro Run command here
Text Box Display: This message every time the macro runs
End Repeat


<VARIABLE SET INTEGER Option="\x01" Destination="%N[1]%" Prompt="How many times do you want to repeat?" Mask="FALSE" OnTop="FALSE" Left="Center" Top="Center" Monitor="0"/><REPEAT START Start="1" Step="1" Count="%N[1]%" Save="FALSE"/><COMMENT Value="Place your Macro Run command here"/><TEXT BOX DISPLAY Title="This message every time the macro runs" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang2057{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs16 Your macro has just been run.\\f1 \r\n\\par }\r\n" Left="Center" Top="Center" Width="278" Height="200" Monitor="0" OnTop="FALSE" Keep_Focus="TRUE" Mode="\x00" Delay="0"/><END REPEAT/>

--
Terry, East Grinstead, UK

#3 nuggles

nuggles

    Newbie

  • Members
  • Pip
  • 17 posts

Posted 01 February 2009 - 11:55 PM

thank you very much terry :)