Jump to content

Clipboard: Get Reference to File


MonoNexo
 Share

Recommended Posts

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

Link to comment
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.
Link to comment
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

Link to comment
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.
Link to comment
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

Link to comment
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.
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...