Jump to content

If then and variables


Recommended Posts

Hi me again,

Ive tried everything and im going nuts.

This is a sample of what im doing, basically, i want a message box to appear when the text in the clip board says a word, in this example, "end"

$y = Clipget()

Winactivate ("Microsoft Excel")

Send ("^c")

If $y= "end" Then

MsgBox(0, "finished", "Stop the Macro,")

Endif

What am i doing wrong? Its not recognising what is in the clipboard memory?or has it something to do with excel?

Thanks in advnace

Link to comment
Share on other sites

Hi me again,

Ive tried everything and im going nuts.

This is a sample of what im doing, basically, i want a message box to appear when the text in the clip board says a word, in this example, "end"

$y = Clipget()

      Winactivate ("Microsoft Excel")

       Send ("^c")

           If $y= "end" Then

                MsgBox(0, "finished", "Stop the Macro,")

           Endif

What am i doing wrong? Its not recognising what is in the clipboard memory?or has it something to do with excel?

Thanks in advnace

<{POST_SNAPBACK}>

Your initial $y = Clipget() does not set up a permanent linkage with the clipboard... it takes a snapshot. Each time you want to evaluate the contents of the Clipboard (i.e. after the content changes) you must do another Clipget().

Dale

Edited by DaleHohm

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

Dale, thanks for your reply.

Even when i run the above with just one cycle, ie, it only has ever had one item in the memory it doesnt work, it seems to not recognise what has been copied from excel.

Link to comment
Share on other sites

Excel is possibly copying extra data before or after the keyword or it is copying in a non-plain-text format.

Try checking for the keyword's presence using If StringInStr(ClipGet(), "end").

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...