Appending Text using TypeText? Increments?

Hello!

So, I want to set a script up to simply go to our website and register a new user… then another one… then another one… then another one… to about 100… and they told 2 friends and they told 2 friends… remember that ad? silly wasn’t it… and since i didn’t wash my hair in the 70’s who cared anyway?

But I digress… So when I TypeText into a field how do I make it type something different each time… say the first run Type User1, Second Run User2, and so on… oh… and repeat the script 100 times? Interesting huh?

Thanks for any help!

Hello, bass-o-matic–

You could put the users into a text file:
User1
User2
user3
user4

Then you can say:

put file "/Path/to/users.txt" into userList
repeat with each item user in userList
...do your registration stuff here...
end repeat

Does this help? If you wanna get really fancy, you can create a property list.

Or slightly less fancy…

repeat 100 times
    typetext "User" & repeatIndex() 
end repeat

The & is the concatenate operator, repeatIndex() is a function to return the current index of the innermost loop.

I like em both! I’ll check em both and report back… thanks gang!

[quote=“JonathanOSX”]Or slightly less fancy…

repeat 100 times
    typetext "User" & repeatIndex() 
end repeat

The & is the concatenate operator, repeatIndex() is a function to return the current index of the innermost loop.[/quote]

Just goes to show where I am working today. That is much quicker…

less fancy=much less chance of falling down the well. Both methods have merit, but for now the simple one is “betterer”. Data files play an important role.

I fell down the big one today…calling a data file that didn’t have the right name ( too many camera models swimming in my head, each with a different set of characteristics) . Too many big white pills today also. How many ways can I say:

TypeText “d” & “u” & “h”