But what if the frame doesn't have an identifier AND the number keeps changing? In this case, you can use some scripting code to create a loop that will iterate over frame numbers until the target element is found. It's a bit crude, but it's effective.

The following code snippet attempts to save an image which is located in a frame where the frame number is not known.

Do im.iimSet("loop", i) If im.iimPlay(macroSaveImage) = 1 Then Exit Do End If i = i + 1Loop

This example assumes you are using VB script with the iMacros Scripting Edition, but the logic is essentially the same if you are using the built-in Javascript scripting interface with iMacros for Firefox:

You may have noticed an increasing trend for websites to use dynamically generated frame names, which also can't be used for reliable playback. For this reason, we enhanced the Expert click-mode in V7.36. Now when you record using the Expert click-mode inside of a frame, iMacros will by default record the frame name (if one exists), but it will also record a commented-out FRAME command that contains the frame number. If the frame name is random or dynamically generated each time by the website, then you have the option to edit your macro to use the frame number instead.