DonationCoder.com Software > Finished Programs
SOLVED: Attach or upload to FTP utility
huismus:
Hello everyone,
I recently moved abroad and email is a huge part of staying in touch with friends and family back home. I'd like to more efficiently upload pictures (and other files) to them. I use AHK to create some keyboad shortcuts, but nothing you could call "programming". From searching the forum, I know that most components I think are needed to create this utility are available, but I have no idea how to put it together.
So here goes... The "Attach or upload to FTP utility" should do the following:
Whenever I drag and drop a file onto a MS Outlook message window, a window should pop-up giving me two options:
1. Upload file to FTP
2. Attach to email
If I choose 2, the file gets attached and nothing else happens.
If I choose 1, the following happens:
- A small FTP browser window opens a pre-determined FTP site
- I can browse to a desired folder or create a new one
- By clicking "upload", the file gets uploaded, and a link to the folder (i.e. the location of the file) gets pasted into the message body
That's it! Nice additions to this functionality would be:
- Drag and drop multiple files onto the MS Outlook message window
- A threshold for minimum filesize (so the utility doesn't pop up for small files)
- Checking the "To" field of the message to determine if the utility should pop-up (so you only send FTP uploaded attachment mails to recipients with FTP access).
I'm looking forward to your ideas!
Huismus
skwire:
Welcome to the site, huismus. The biggest obstacle in your idea is almost certainly going to be trying to capture that drag & drop event. Personally, I don't think it can be done elegantly from outside of MS Outlook.
huismus:
Thanks for the reply Skwire. I've been trial-and-erroring a lot with the drag-and-drop issue. I came up with the following workaround:
~LButton::
KeyWait, LButton, T0.5
if ErrorLevel ; timed-out (Button is not yet released after more then 0,5 s.)
{
Keywait,Lbutton ; Watch for buttonrelease
Sleep, 100 ; Wait for the message window to become active after drop (this might be unnescessary)
WinGetActiveTitle, Title
IfInString, Title, Message ; Check if active window is an outlookmessage
MsgBox This is where an FTP GUI should appear
}
return
--- End quote ---
(Thanks to Lexikos)
I then found that this would also trigger when the message window was being dragged or resized. That's why I added a WinGetActiveTitle comparison as follows:
~LButton::
KeyWait, LButton, T0.5
if ErrorLevel ; timed-out (Button is not yet released after more then 0,5 s.)
{
WinGetActiveTitle, Prev_Title
Keywait,Lbutton ; Watch for buttonrelease
Sleep, 100 ; Wait for the message window to become active after drop (this might be unnescessary)
WinGetActiveTitle, Title
IfEqual Title, %Prev_Title%
Return
IfInString, Title, Message ; Check if active window is an outlookmessage
MsgBox This is where an FTP GUI should appear
}
return
--- End quote ---
Now, this is just a workaround... It'd be great if I could somehow "see" there's a file hanging on the tip of the mousepointer. Especially if I want to drag&drop multiple files onto the message window. I appreciate any input you might have
huismus:
I found a solution in OutDisk FTP
Which does what I want, in a slightly different way.
skwire:
Very nice. Thanks for reporting back. :Thmbsup:
Navigation
[0] Message Index
[#] Next page
Go to full version