Clipboard command

Suggestions, feature requests and bug reports.
Post Reply
orlando2bjr
Posts: 27
Joined: Oct 3rd, ’17, 12:26

Post by orlando2bjr » Aug 13th, ’18, 18:49

Hi, using this command:

Code: Select all

clipboard = "" ; Start off empty to allow ClipWait to detect when the text has arrived.
Send ^c
ClipWait
characters := StrLen(clipboard)

Menu, Tray, Icon
TrayTip Caracteres, %characters% com espaços
I get this error:

Code: Select all

---- #ErrorStdOut
622: i := VarSetCapacity(e,520) DllCall("GetModuleFileName",PTR,0,Str,e,UInt,260) VarSetCapacity(e,-1)
005: CoordMode,Mouse,Screen
006: SendMode,Input
007: SetTitleMatchMode,RegEx
012: Return (0.06)
628: Suspend,On
629: Suspend,Off
630: Return (216.42)
190: Clipboard = ""
191: Send,^c (0.01)
192: ClipWait
193: characters := StrLen(clipboard)
195: Menu,Tray,Icon (0.03)
196: TrayTip,Caracteres,%characters% com espaços
197: Return (3.53)
It also included Usage Statistics in the report, but since I've disabled it, it disappeared.

The shortcut is CTRL+SHIFT+ALT+WINDOWS+C.
Results are correct though.
orlando2bjr
User avatar
Tom
Posts: 543
Joined: Nov 24th, ’15, 23:39

Post by Tom » Aug 13th, ’18, 19:14

Running your script gives me no error. Can you post a printscreen?
orlando2bjr
Posts: 27
Joined: Oct 3rd, ’17, 12:26

Post by orlando2bjr » Aug 13th, ’18, 19:41

Sure, here it is:



It seems to happen on other functions as well, such as text expander. I've never noticed that. I thought it was normal for the autohotkey icon to stay in the tray after a command.
orlando2bjr
User avatar
Marko
Posts: 1384
Joined: Mar 2nd, ’13, 21:02

Post by Marko » Aug 14th, ’18, 05:11

Tray icon? Do you use Type: Script?
orlando2bjr
Posts: 27
Joined: Oct 3rd, ’17, 12:26

Post by orlando2bjr » Aug 14th, ’18, 20:04

No, at least not that I know of. I just used that command that I got from AHK help.

The tray icon I was referring to was this:


I thought this was normal behavior, but now I think it keeps showing up because of this error.
orlando2bjr
User avatar
Marko
Posts: 1384
Joined: Mar 2nd, ’13, 21:02

Post by Marko » Aug 15th, ’18, 19:54

Sorry, I can’t reproduce this. Could you send me your settings files with a detailed description of steps to reproduce it?
orlando2bjr
Posts: 27
Joined: Oct 3rd, ’17, 12:26

Post by orlando2bjr » Aug 19th, ’18, 14:21

Here it is.

Steps to reproduce:
  1. Select text
  2. Press CTRL + SHIFT + WIN + ALT + C (I use an ergodox keyboard)
  3. Watch the notification with character count.
  4. Authotkey icon appears on traybar and never closes. Open it to show error.
orlando2bjr
User avatar
Marko
Posts: 1384
Joined: Mar 2nd, ’13, 21:02

Post by Marko » Aug 20th, ’18, 18:48

Thanks. This is not an error but the result of showing the system tray icon in your script.

I suggest you using ToolTip, MsgBox instead of TrayTip.
orlando2bjr
Posts: 27
Joined: Oct 3rd, ’17, 12:26

Post by orlando2bjr » Aug 23rd, ’18, 19:46

It's much better with tooltip. I skipped the msgbox to avoid having to click to dismiss.

Code: Select all

clipboard = ; Start off empty to allow ClipWait to detect when the text has arrived.
Send ^c
ClipWait
characters := StrLen(clipboard)

; Menu, Tray, Icon
; TrayTip Caracteres, %characters% com espaços

ToolTip %characters% com espaços
SetTimer, RemoveToolTip, -2000
return

RemoveToolTip: 
ToolTip
return 
Thanks a lot.
orlando2bjr
Post Reply