here's hoping this gets noticed, as the last post was from '07
I wrote a script that brings up a little input window to search an online dictionary with the word typed in the window. I use a winkey combo, #s. what I want to do is be able to toggle the window on or off (off with winkill) with that combo, but I can't seem to get it to. I know I can't put in the same hotkey more than once, so I've been trying to find other ways around it.
ive tried toggling variables as a means of control with if checks, ive tried the minmax trick posted above, ive tried ifwinexist, ive tried using another script that had #s code in it... but it all doesn't seem to matter, since apparently while the search window is open the script won't recognize #s.
I thought it might be because the script can't intercept any keystrokes that are listed above it, but I put in a #c hotkey above it that uses winkill to kill it, and it worked. sure, this isn't quite a necessary feature, the windows does come with a cancel button, but I still want to make it toggle-able using the same hotkey. here's my code:
inputbox, word, Search-O-Matic, Search a word on www.dictionary.com:
, , , 120, 0,875
ifwinexist Mozilla Firefox
gui, font, s20, verdana
gui, add, text,, URL copied to clipboard
msgbox, 16,, Please open Firefox before attempting to search.`nNote that Internet Explorer is not supported.
(I put in the explicit use of firefox because I never use ie and didn't want to code a preference thing - plus the main reason is because I didn't want to have to watch the script mess up because of variable loading times when starting the browser.)
all help is muchly appreciated!