Jump to content

Need some help with paste.


Recommended Posts

Ok, I am a total newbie at coding with anything(Maybe HTML but who doesnt know that). Anyways I never learned it. I am trying to accomplish a very basic simple bot. I thought it would be simple since I was emulating only a few mouseclicks and keypresses. I read up on the faqs and it made my mind go into a complete :P

Here's the scenario, I want to make the script standby when opened and will run right away when I press a shortcut like CONTRL+ I want to be copy text from 'tab1' of firefox and paste it into 'tab2' of firefox.

Here's what I have so far. :(

; TO RUN USE A SHORTCUT KEY

; LOCATE ("firefox.exe")

WinWaitActive("Weight of the World On Both Shoulders - Mozilla Firefox")

Sleep(3000) ; RUN A MACRO SHORTCUT FOR EVERYTHING BELOW

MouseClick("left", 130, 125, 1, 1)

Sleep(1000)

MouseClick("left", 500, 500, 2, 1)

Send("CTRL"+"c")

Sleep(1000) ; I could not get anything to work after this.

Send("CTRL"+"TAB")

Sleep(1000)

Send("CTRL"+"v")

Sleep(1000)

Send("Enter")

Exit

Basically I rewritten the script a few dozen times with my limited knowledge but to no avail. I could not get Control+tab(or #2 for window#2) to work. By then I opted for MouseClick "left, yada yada yada", which worked. Then I couldn't get it to paste from the clipboard. I tried to understand how to retrieve data from clipboard and paste it but I'd rather it just simulate the keys to paste it. My script also did not simulate the enter key either.

And I havn't found anything on RUN on keypress/command yet for the script so I'll leave that optional for now but would like help on that too.

Edited by polandSPP
Link to comment
Share on other sites

It seems like you forgot { }, like Send("{Enter}") have you readed the readme? :P

clipget() i think and use a loop to get all from it. And you can use "_ClipBoard_GetData " to i think.

Im actually new, but i have readed little about it.

Here you have for copy. Send("^c"}, '^' stands for Control/CTRL

Use the "AutoIt Window Info" to get the info from the editbar.

Edited by cparadis
Link to comment
Share on other sites

Never mind, I got the script to work. I have no idea why it didnt work yesterday with the pasting. I thought I wrote "{Enter}" before but changed it because it did not press enter. Maybe I was too sleepy to notice it actually worked. Anyway thanks cpara.

I still need help with setting it to run on command. Like it will standby. I tried to write something for it but got completely confused after like 2 lines. More like I do not know where to start.

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...