Sign in to follow this  
Followers 0
MrSnugglez

Better paste?

9 posts in this topic

Topic says it all. Im trying to learn autoit and right now im wanting to learn how to send data around thats in the clipboard.

Right now the paste function Send("^v") is what i use to put data into a window or something to get the data from the clipboard. The problem is that alot of times it wont paste and missess or something. I dont know.

Can anyone recommend better code for such an action?

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Use FileWrite()

********************

!TAKEN FROM HELP FILE!

$file = FileOpen("test.txt", 1)

; Check if file opened for writing OK
If $file = -1 Then
    MsgBox(0, "Error", "Unable to open file.")
    Exit
EndIf

FileWrite($file, "Line1")
FileWrite($file, "Still Line1" & @CRLF)
FileWrite($file, "Line2")

FileClose($file)

It works great, and the file does not have to be open, it does it by itself. PM if you need a more in depth description of that.

:) Good luck!

Edited by mysterious

[center]Class... Now in session ( Thanks to Valuater )Not much more you need to know. ^_^[/center]

Share this post


Link to post
Share on other sites

Use FileWrite()

********************

!TAKEN FROM HELP FILE!

$file = FileOpen("test.txt", 1)

; Check if file opened for writing OK
If $file = -1 Then
    MsgBox(0, "Error", "Unable to open file.")
    Exit
EndIf

FileWrite($file, "Line1")
FileWrite($file, "Still Line1" & @CRLF)
FileWrite($file, "Line2")

FileClose($file)

It works great, and the file does not have to be open, it does it by itself. PM if you need a more in depth description of that.

:) Good luck!

Thanks that seems like it will fix writing directly to a file.

What Im trying to do is write to differant windows. Like say paste a website to my

broswer, or open my aim and paste something to a window where im chatting to a friend. Im not sure writing to a file could help with that.

Share this post


Link to post
Share on other sites

I see what you mean, there is commands for that, like

ShellExecute()

Well, I'm tired ill see what I can do tomorrow, check the help file for that, though.

:) Good luck.


[center]Class... Now in session ( Thanks to Valuater )Not much more you need to know. ^_^[/center]

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Share this post


Link to post
Share on other sites

mysterious, what are you on about... :)

The functions you need are:

ClipGet ( )

ControlSend ()

EDIT: Spelling.

Thank you I will take a closer look at these :)

Share this post


Link to post
Share on other sites

mysterious, what are you on about... :)

The functions you need are:

ClipGet ( )

ControlSend ()

EDIT: Spelling.

He said, "Paste a website to my browser"...


[center]Class... Now in session ( Thanks to Valuater )Not much more you need to know. ^_^[/center]

Share this post


Link to post
Share on other sites

And ShellExecute() is a command for pasting to a browser? Since when? Have I missed something?

I was wondering the same thing.. *confused*

Share this post


Link to post
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
Sign in to follow this  
Followers 0