Jump to content
Macro Express Forums
Gerry Peters

Can a macro repeating 20x, each time put different text in 1 box?

Recommended Posts

I have a macro set up that enables me to share a Facebook video to about 20 different Facebook groups by hitting a hot key. each Facebook group has it's own macro and my hot key starts a group of macros running them 1 at a time until all 20 are done. 
 
Facebook keeps changing the share window and then I have to redo all 20 macros. Every macro is exactly the same except for where the macro puts the name of the Facebook group in the box.
 
So I'm wondering if Macro Express can instead run 1 macro 20 times, but each some put a different name in the box corresponding to each Facebook group? In other words only 1 command in the Scripting Editor would be the one that changes with each successive run of the macro until all 20 names are used.
 
This way if I have to change the macro in the future I only have to change 1 macro not 20 macros
 
Can this be done?

Share this post


Link to post
Share on other sites

Yes. There are several ways you could do it. For instance you could use an array variable set up to contain the group names and its index could match the count through the Repeat loop.

Share this post


Link to post
Share on other sites

Perhaps something like this...

 

// Set URLs for Facebook groups here...
Variable Set String %Group[1]% to "/facebook.com/AAAAA"
Variable Set String %Group[2]% to "/facebook.com/BBBB"
Variable Set String %Group[3]% to "/facebook.com/CCC"
// Etcetera
 
Variable Set Integer %Count% to 1
Repeat Start (Repeat 3 times)
  Variable Set String %Target% to "%Group[%Count%]%"
  // The next line confirms the macro is on track...
  Text Box Display: %Target%
  Variable Modify Integer %Count%: Increment
  // Do something with the URLs...
   
   
End Repeat

 

Share this post


Link to post
Share on other sites
21 hours ago, terrypin said:

Yes. There are several ways you could do it. For instance you could use an array variable set up to contain the group names and its index could match the count through the Repeat loop.

 

 I like your solution. Below is the commands for variables for ME 3.10. I didn't see array variable listed. I assume I can use one of the commands below to get this done. Can you give me some guidance? I've used ME for many years, but I'm still pretty basic in the macros I've created. 

 

1355595815_macroexvariables.JPG.6994e14899e763917f32476444d888b1.JPG

Share this post


Link to post
Share on other sites

Check Version 3.10 help to find out whether it supports arrays.

 

If it doesn't, you will need to update to Version 5 or 6.

 

If it does support arrays, you can use my code sample as a starting point, but you will need to rename all of the variables: Text variables, such as %Target% and %Group[x], to T[1]. T[2], etc.; and the integer variable %Count% as %N[1]%.

Share this post


Link to post
Share on other sites

Gerry,

 

I'd echo @acantor's suggestion to update to a current version. As you've discovered, 3.10 did not support arrays in the form we have now but in fact its entire variable structure was based on arrays. For example T[1], a unique string variable, was treated as the first in an array of 99.

 

So if you do decide to stay with 3.10 then you could still follow the approach suggested, but it would be a little clumsier. Start with @cantor's code and tell us when you have difficulty progressing.

 

Terry

 

Share this post


Link to post
Share on other sites
 I'm considering version 5. From what I see I'd need to pay the full $49 for version 5 and not a discounted upgrade from version 3. Is that correct? Not complaining just trying to understand. With version 5, I can still run all of my version 3 macros, Right?  

Share this post


Link to post
Share on other sites

Yes to the compatibility question (although you may want to make some minor changes). You could also take advantage of the free 30 day trial. On a possible discount I’d check with Insight Support either by direct email or via their Support Request form if you don’t get a response from them here.

 

Share this post


Link to post
Share on other sites

Definitely take advantage of the 30 day free trial. If you discover that Macro Express saves you significant time and headache, perhaps $49 will seem like a modest sum. It is hard to imagine the amount even partially covers the cost of developing the program. When I first began using Macro Express about 20 years ago, I figure I recovered the cost, in terms of increased speed and accuracy, in under an hour.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...