Ctwizzy Posted October 11, 2006 Share Posted October 11, 2006 I frequent a website designed entirely in flash, its really annoying. Anyways in order to access a certain part of the site you need a key, so you request a key and the app sends it to your email. key is numeric: "12-345-67". Of course the flash web app has 3 boxes to enter this key, and copy pasting it all in segments is a pain. So I saw this app can do scripts. So basically what im trying to do is, whatever I have copied in clipboard, just paste it. for example: $clipb = ClipGet() ;Get the Contents of the clipboard $parts = StringSplit($clipb, '-') Send("" & $parts[1] & "{TAB}" & $parts[2] & "{TAB}" & $parts[3] & "{TAB}" ) I then compile this app, and have a keyboard macro program for running the exe. All I then want is whenever the keyboard macro is hit, it pastes the clipboard as so. Im trying to get this to work and so far whenever it runs myscript.exe it loses focus. I just want it to paste whereever I am at that time, in the flash app. Would appreciate some guidance. Thanks! Link to comment Share on other sites More sharing options...
AutoChris Posted October 11, 2006 Share Posted October 11, 2006 (edited) I think the best way to do this is to run your script in a While/WEnd loop and put your Send... statement as a Hotkey. Example: HotKeySet("{F8}", "SendIt") While 1 Sleep(250) WEnd Func SendIt() $clipb = ClipGet() ;Get the Contents of the clipboard $parts = StringSplit($clipb, '-') Send($parts[1] & "{TAB}" & $parts[2] & "{TAB}" & $parts[3] & "{TAB}" ) EndFunc Or something like that. That way you will not lose focus on the screen when you run your app. Another way is to just put a Sleep(3000) or so in the beginning of your script so that you have time to click on the screen before your script starts. Edited October 11, 2006 by SerialKiller Link to comment Share on other sites More sharing options...
ame1011 Posted October 11, 2006 Share Posted October 11, 2006 I think the best way to do this is to run your script in a While/WEnd loop and put your Send... statement as a Hotkey. Example: HotKeySet("{F8}", "SendIt") While 1 Sleep(250) WEnd Func SendIt() $clipb = ClipGet() ;Get the Contents of the clipboard $parts = StringSplit($clipb, '-') Send($parts[1] & "{TAB}" & $parts[2] & "{TAB}" & $parts[3] & "{TAB}" ) EndFunc Or something like that. That way you will not lose focus on the screen when you run your app. Another way is to just put a Sleep(3000) or so in the beginning of your script so that you have time to click on the screen before your script starts. hotkeys are definitely the way to go... I would also suggests placing a WinActivate right before you paste the values in [font="Impact"] I always thought dogs laid eggs, and I learned something today. [/font] Link to comment Share on other sites More sharing options...
Ctwizzy Posted October 12, 2006 Author Share Posted October 12, 2006 Thanks Serial that did the job!! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now