08-02-2016, 10:22 AM
I have a macro that works fine with a key like F3 as the trigger. I want to use Wg (windows + g) as the trigger. If I use that trigger:
- the macro works fine if I put a delay of 0.2 at the top
- with a delay of 0.1 or no delay all sort of strange things happen:
All this does not happen if I use the Wg trigger with a simple macro that displays a message box.
I'm using windows 10, I have 'use low-level hook' checked.
The macro code is below, the purpose of the macro is, when a windows explorer window is active, to get the address of the folder it's showing, and show the same folder on my memory stick in the same explorer window (with the $Personal$ part omitted)
Macro memstick_show_same_dir
Trigger Wg
(The try_findfile_on_drive2 gets the driveletter of the memorystick)
Can anybody tell me what the problem is?
- the macro works fine if I put a delay of 0.2 at the top
- with a delay of 0.1 or no delay all sort of strange things happen:
- * I'm logged of, have to enter my username to log in again
* when I'm logged in the ease of access center dialog is showing, the narrator has been activated
* the run-dialog from the start menu is open
All this does not happen if I use the Wg trigger with a simple macro that displays a message box.
I'm using windows 10, I have 'use low-level hook' checked.
The macro code is below, the purpose of the macro is, when a windows explorer window is active, to get the address of the folder it's showing, and show the same folder on my memory stick in the same explorer window (with the $Personal$ part omitted)
Macro memstick_show_same_dir
Trigger Wg
int memstickdrivenummer = try_findfile_on_drive2("x:\memstick.txt")
if memstickdrivenummer = 0
,mes "memstick not found"
,end
int w=win("" "CabinetWClass")
str dirname.getwintext(id(1001 w)) ;;get text/name of address bar
if dirname.begi("address:")
,dirname.get(dirname 8)
dirname.trim
str mydocs.expandpath("$personal$")
if dirname.beg(mydocs)
,dirname.get(dirname,len(mydocs)+1)
,dirname.from("x:\" dirname)
dirname[0] = memstickdrivenummer
iff-(dirname)
,mes "Directory does not exist on memstick"
,,end
'Cl(dirname)Y ;;activate address bar and type memstick path
0.05
act child("" "DirectUIHWND" w 0x0 "accName=Items View") ;;list 'Items View'
(The try_findfile_on_drive2 gets the driveletter of the memorystick)
Can anybody tell me what the problem is?