Amerifax-Bob Posted December 4, 2009 Report Share Posted December 4, 2009 I am not very good with the IF statements and was wondering if someone could help with a small one for me? // Website to T9 Text Type (Simulate Keystrokes): <ARROW DOWN> Text Type (Simulate Keystrokes): <SHIFT><END> Clipboard Copy Delay: 250 milliseconds Variable Set String %T[9]% from the clipboard contents I would like to do the above only if the text=www. The text is in a regular text editor (Ultra Edit). The data I am copying to Variables does not always have a website. So if the Macro finds www I want it to process the part of the Macro above, if not just continue on with the rest of the Macro. I did try searching around first, but did not have much luck. Thanks for any help, Heather Quote Link to comment Share on other sites More sharing options...
Cory Posted December 4, 2009 Report Share Posted December 4, 2009 Here's a quick example. ................................... I don’t know what your variables are but let’s say the text you want to test is T1. Also I’m going to assume that your condition is if it contains WWW, and not an exact match. I am also assuming that your condition is not case sensitive. EG you want to do it if it’s “www” or “WWW”. Here’s your command: <IF VARIABLE Variable="%T[1]%" Condition="\x06" Value="www" IgnoreCase="TRUE"/> <COMMENT Value="Put your commands in here."/> <END IF/> You can copy and past it to the script editor. It will then look something like this: If Variable %T[1]% Contains "www" // Put your commands in here. End If Quote Link to comment Share on other sites More sharing options...
Amerifax-Bob Posted December 4, 2009 Author Report Share Posted December 4, 2009 Cory, This is an example of the text I am putting into Variables. America In-Home T[2] 3485 N. 124th Street T[3] Brookfield T[4] WI T[5] 53005 T[6] 262-790-4050 T[7] 262-781-2849 T[8] www.americainhome.com T[9] There is not always a website. So when it gets to the point that it is going to select and copy the website to a Variable, I would like it to check first if the text contains www. If it does then continue on and copy the website to T[9] and if not, just continue on with the Macro. Sorry I should have clarified that more. Is that possible to check with an IF statement since it is not yet in a Variable, or should I use 2 variables in this instance. One to copy the line to a variable for checking and another to hold the proper variable if the condition is met? I did figure out the IF Variable within my Macro for other instances but this one was a little different. Heather Quote Link to comment Share on other sites More sharing options...
kevin Posted December 7, 2009 Report Share Posted December 7, 2009 Since the variable you need to check is in T[9] use Cory's example and change the %T[1]% to %T[9]%. // Website is in T9 If Variable %T[9]% Contains "www" Text Type (Simulate Keystrokes): <ARROW DOWN> Text Type (Simulate Keystrokes): <SHIFT><END> Clipboard Copy Delay: 250 milliseconds Variable Set String %T[9]% from the clipboard contents End If Quote Link to comment Share on other sites More sharing options...
Cory Posted December 7, 2009 Report Share Posted December 7, 2009 What Kevin said. ..................................... Also I recommend you just play around and try the logic commands in a scratch macro. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.