Sign in to follow this  
Followers 0
MonoNexo

Clipboard: Get Reference to File

8 posts in this topic

Hi all,

I'm trying to figure out some way to pass by reference the location of a file such that if pasted into Outlook, it'll treat it as a file attachment.

I've tried just putting the location of the file into the clipboard, but that doesn't work (using clipPut()). I'm pasting using Send("^v");

I realize that clipPut is just putting a string of text. I scoured the documentation for something that would actually put a reference to the file.

Any help is appreciated!

Thanks,

Matt

Share this post


Link to post
Share on other sites



Hi all,

I'm trying to figure out some way to pass by reference the location of a file such that if pasted into Outlook, it'll treat it as a file attachment.

I've tried just putting the location of the file into the clipboard, but that doesn't work (using clipPut()). I'm pasting using Send("^v");

I realize that clipPut is just putting a string of text. I scoured the documentation for something that would actually put a reference to the file.

Any help is appreciated!

Thanks,

Matt

Welcome to the forums :)

I'm not sure what you mean I'm afraid. If you want to add a file as an attachment in Outlook then why do you paste it? I'm obviously missing something.


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

Welcome to the forums :)

I'm not sure what you mean I'm afraid. If you want to add a file as an attachment in Outlook then why do you paste it? I'm obviously missing something.

I'm trying to automate it without using the mouse. I'm thinking something along the lines of:

clipPutFile("C:/data.png");

Send("^v");

in the body field of the email, which in Outlooks case, will attach "C:/data.png" to the email.

If you use:

clipPut("C:/data.png");

Send("^v");

Because that's putting a string of text and not treating it like a file reference, Outlook will put "C:/data.png" as part of the message body, not an attachment.

Hope that helps explain...

Matt

Share this post


Link to post
Share on other sites

I'm trying to automate it without using the mouse. I'm thinking something along the lines of:

clipPutFile("C:/data.png");

Send("^v");

in the body field of the email, which in Outlooks case, will attach "C:/data.png" to the email.

If you use:

clipPut("C:/data.png");

Send("^v");

Because that's putting a string of text and not treating it like a file reference, Outlook will put "C:/data.png" as part of the message body, not an attachment.

Hope that helps explain...

Matt

I think I see. You want something that would act like the imaginary ClipPutFile?

Then you could try this; I haven't and I have no idea if it will work.

$text = Fileread("C:\data.png");
Clipput($text)
Send("^V")

I'd be interested to know if it does work though.


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

Hay Matt Go An MSG? If So Add (maxell225@hotmail.com) And I Can Help You I Think O.o


Latest Projects :- New & Improved TCP Chat

Share this post


Link to post
Share on other sites

Woot!

Special thanks to John O. for pointing out that infact, clipPutFile() exists! I had to upgrade to the newest version of autoit, but sure enough, it works like a charm.

Example:

#include "misc.au3"

_ClipPutFile('C:/5.jpg')

Thanks all!

Matt

Share this post


Link to post
Share on other sites

I'm Glad I Could Help You Matt :)

--John O.

Thanks from me too, I'd never noticed that function.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

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