topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Tuesday April 16, 2024, 9:43 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - huismus [ switch to compact view ]

Pages: [1]
1
Thank you MilesAhead,

Sorry for the late reply, I was distracted by other projects. It's good to know the clipwait returns earlier if the data is ready. Also, thank you for the tips for better code.

My code now works fine for it's original purpose, using GUIControl. However for MsgBox, i really need a clipwait of 2 seconds. It seems like MsgBox is much slower then GUIControl.

Thanks again!
Andre

2
Thanks for the help MilesAhead! I'm now using:
Send ^c
ClipWait, 1
clipboard = %clipboard%
MsgBox %clipboard%
The difference between an empty msgbox and a msgbox with the title was:
clipboard = %clipboard%

Case closed :up:

 >:( grmph...

Still having issues with it after I added the clipsaved option. The script works fine like this:
MButton::
;ClipSaved := ClipboardAll
;ClipWait, 0.2
SetTimer, CopyFileName, Off
;clipboard =
click
Send ^c
ClipWait, 0.2
clipboard = %clipboard%
MsgBox %clipboard%
;clipboard:= ClipSaved
Return

But I once again get an empty string in the message box if I uncomment the clipboard related lines (3x). Somehow it seems like messagebox is slow and the script goes ahead changing the content of the clipboard before the msgbox is rendered??  :huh:
BTW: As you see I changed the hotkey from !Lbutton to MButton.

3
Thanks Miles, That's a good idea. But leads me to two new questions:
- Would this require a lot of memory?
- In VBA you'd set an object to Nothing as good coding practice. Is this possible in AHK?

Also, I still do not understand why my code snippet returns an empty string.

BTW: I also tried the following code of Skwire:
#c::
{
    SendInput, ^c ; Copy image path to clipboard.

    SplitPath, Clipboard, myFileName ; Get filename from the path.

    Clipboard := "http://www.site.com/" . myFileName ; Concatenate string and copy it to the clipboard.

}
Return

Copied from this forum topic; This also returns an empty string... I must be doing something very basic wrong. :huh:

4
I've created a small GUI with an Edit element where users can type a filename, this filename is submitted with a button and based on part of the filename string, the GUI gets expanded with different elements.

The problem is as follows: The typical filename to be typed is over 25 characters long and typing it is rather error prone. So... I'm working on adding a button that
hides the GUI, allows the user click to an explorer window and Alt-LMBclick on a filename. The filename then gets placed in the edit element and the GUI is unhidden. As the user may have valuable data on the clipboard, I do not want to use the clipboard for this.

I've been trying to use this code:
TitleCopyExplorer:
SetTimer, Explorecopy, 150
return
Explorecopy:
If WinActive ahk_group Explore
{
explorerClass = ExploreWClass

~!Lbutton::

WinGetClass explorerClass, A
ControlGet, selectedFile, List, Selected Col1, SysListView321,ahk_class %explorerClass%
msgbox %selectedFile%
}
return
(modified from: this forum topic)

However, this just returns an empty string in the msgbox.

Thanks for your help.
Huismus


5
Finished Programs / Re: IDEA: Attach or upload to FTP utility
« on: November 09, 2012, 03:32 AM »
I found a solution in OutDisk FTP

Which does what I want, in a slightly different way.

6
Finished Programs / Re: IDEA: Attach or upload to FTP utility
« on: October 12, 2012, 04:05 AM »
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

(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

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

7
Finished Programs / SOLVED: Attach or upload to FTP utility
« on: October 01, 2012, 01:31 AM »
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

Pages: [1]