问题
FF 42.0 Imacros for FF BUILD=8940826 Early 2008 8 core MacPro OSX 10.8.2
Looking to press however many buttons happen to be present within a given frame. I suppose I could just loop up to some unreasonably large number and ignore errors, but that seems clumsy to me.
So, if a button press for the first button in the frame looks like this:
TAG Pos=1 TYPE=Button ATTR=DATA-LOG-CLICK:add-button
and each one after that varies only by the TAG Pos#, is there a way to search for the highest TAG Pos#, then press every button up to that last one? If this is a well known item, I must just be lacking the proper search term.
回答1:
// What you asked for can be done with JS.
var macroClick;
macroClick ="CODE:";
macroClick +="TAG Pos=1 TYPE=Button ATTR=DATA-LOG-CLICK:add-button";
var macroClickTest;
macroClickTest="CODE:";
macroClickTest +="TAG Pos=1 TYPE=Button ATTR=DATA-LOG-CLICK:add-button CONTENT=EVENT:MOUSEOVER";
var pos=1;
while(true)
{
iimSet("n",pos)
if(iimPlay(macroClickTest)<0)
{
pos--;
iimPlay(macroClick)
}
pos++;
}
来源:https://stackoverflow.com/questions/33586725/imacros-press-all-number-varies-buttons-within-a-given-frame