cannot open clipboard

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
derail

cannot open clipboard

Post by derail » Fri Nov 22, 2002 4:49 pm

I'm trying to set up a way to have a conversation with one of my buddies via Windows Messenger, and at the same time scan the chat window for a certain phrase, that phrase being the "password" to start remote assistance..so that if my buddy uses the correct "password" I'll have the text check macro continue to the app sharing macro.

I keep getting an error from macro scheduler that says...

"cannot open clipboard"

Here's the search for text code...however if anyone has a better way PLEASE tell me. I have this macro set to engage everytime the chat window Josh* is open, so from there, here we go...

Label>textcheck
Wait>5
ifwindowopen>Josh*,continue
goto>end
label>continue
SetFocus>Josh*
//copy all text to clipboard
press shift
press tab
press tab
release shift
Press Ctrl
Send>ac
Release Ctrl
press tab
press tab
//this is the part that I don't understand, someone else wrote this for me
GetClipBoard>thetext
//um and don't understand this here
Position>yourphrase,thetext,1,p
If>p=0,textcheck
macro>startappsharing
label>end

Thanks to all who help! :D

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Fri Nov 22, 2002 5:40 pm

Hi,

The problem is that you are copying to the clipboard and then *immediately* trying to access the clipboard to get the data - but the clipboard is probably still locked for writing.

Simple solution is to add a Wait statement of a second or two before the GetClipBoard command.

The Position command is returning the starting position of yourphrase in the clipboard text. You probably want to define yourphrase somewhere as I doubt this literal in the clipboard.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts