The more advanced stuff really depends on the complex things you are wanting to do. But I can offer a few pointers right off the bat.
- I would put all of those links into a list and just repeat with each item Link of LinkList.
- Typing out a whole hyperlink is a bit painful (depending on the length). I’d set the remoteclipboard to “URL” typetext cotnrolkey, “v”, returnkey also controlkey, “l” is the hotkey for getting to the chrome address bar. I also recommend using typetext windowskey, “r” typetext BrowserVar&&URL_Var then you can launch chrome WITH a URL instead of typing it in. You can paste into the run window too of course.
- Learn to love repeatindex() or the repeatindex it is super-duper helpful for all kinds of stuff in repeats. You could use it to move your Link5 stuff into the repeat. I’d put a conditional statement in there, something like: if the repeatindex + 1 is “” else Click “newtabChrome” Or use not “”, whatever. Eggy is super speedy about processing conditional statements that aren’t looking for junk on the screen, so there is no reason to be concerned about the fact that it is processing a conditional statement EVERY time it repeats, it doesn’t care and the benefits of avoiding ‘special’ circumstance code like your Link5 stuff above is obvious.
- Once you start putting things in lists and processing them that way it won’t be long before you start wanting even more identifiers/controls/parameters/etc and the best way to do that is with Property Lists.
Here’s one I wrote yesterday
Repeat with each item Datum of the keys of DataList
Log “Looking for…”,“Header:”&& DataList.(NextDatum).FieldHeader,“Value:”&&DataList.(NextDatum).FieldValue
put (item (the repeatindex)+1 of the keys of DataList) into NextDatum
ScrollLeft DataList.(NextDatum).FieldHeader
assert that imagefound(text:DataList.(NextDatum).FieldValue, searchrectangle:[CheckForEndOfList (DataList, NextDatum),Row+15,left of imagerectangle(DataList.(Datum).FieldHeader),Row-15]) with error “Looking for FieldValue:”&&<<">>&DataList.(NextDatum).FieldValue&<<".>>&&“Under the Header:”&&<<">>&ParseFieldName (DataList, NextDatum)&<<".>>
add 1 to DatumCount
End Repeat
This was a modification of a repeat I call “The QA Engine”. With some modification it can scroll through any page and look for OCR text relative to any 1 or 2 images. It uses a fresh searchrectangle that is dynamically generated and indexes through a list to find the things you want. It nests functions and generic handlers into the assert to monitor the need to scroll and provides nice logging and throughout. I put it in a TestCase and then I can spit out all kinds of useful information when its done.
This particular one examines the page “backwards” (right to left in this example) which is especially weird, but that’s how the QA lead wanted it. It uses the relative position of the NEXT field to the current field to find stuff.
Nesting functions into searchrectangles is fun
.
Hope some of that helps.