Messages - huismus [ switch to compact view ]

Pages: [1] 2next
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.

Pages: [1] 2next
Go to full version