taurus905 Posted March 13, 2007 Share Posted March 13, 2007 The topic says it all. This simple task has given me a headache and I would appreciate someone showing me what I am overlooking. I think I am burnt out today. This should be very easy. Thanks in advance. taurus905 "Never mistake kindness for weakness."-- Author Unknown --"The highest point to which a weak but experienced mind can rise is detecting the weakness of better men."-- Georg Lichtenberg --Simple Obfuscator (Beta not needed.), Random names for Vars and Funcs Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 13, 2007 Moderators Share Posted March 13, 2007 Global $hTxtFile = '' HotKeySet('{ESC}', '_EXITNOW') HotKeySet('!{HOME}', '_OpenText') $hTxtFile = 'txt.txt';Making it global you can change the value anywhere. While 1 Sleep(1000000) WEnd Func _OpenText() ShellExecute($hTxtFile) EndFunc Func _EXITNOW() Exit EndFunc Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
taurus905 Posted March 13, 2007 Author Share Posted March 13, 2007 Global $hTxtFile = '' HotKeySet('{ESC}', '_EXITNOW') HotKeySet('!{HOME}', '_OpenText') $hTxtFile = 'txt.txt';Making it global you can change the value anywhere. While 1 Sleep(1000000) WEnd Func _OpenText() ShellExecute($hTxtFile) EndFunc Func _EXITNOW() Exit EndFuncSmOke_N, You're the man. ShellExecute is what I was looking for. Thank you my friend. taurus905 "Never mistake kindness for weakness."-- Author Unknown --"The highest point to which a weak but experienced mind can rise is detecting the weakness of better men."-- Georg Lichtenberg --Simple Obfuscator (Beta not needed.), Random names for Vars and Funcs Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 13, 2007 Moderators Share Posted March 13, 2007 Your welcome, you could have done it with Run as well just so you know:Global $hTxtFile = '' HotKeySet('{ESC}', '_EXITNOW') HotKeySet('!{HOME}', '_OpenText') $hTxtFile = 'txt.txt';Making it global you can change the value anywhere. While 1 Sleep(1000000) WEnd Func _OpenText() Run(@ComSpec & ' /c "' & $hTxtFile & '"', '', @SW_HIDE) EndFunc Func _EXITNOW() Exit EndFunc Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
taurus905 Posted March 13, 2007 Author Share Posted March 13, 2007 Your welcome, you could have done it with Run as well just so you know:Global $hTxtFile = '' HotKeySet('{ESC}', '_EXITNOW') HotKeySet('!{HOME}', '_OpenText') $hTxtFile = 'txt.txt';Making it global you can change the value anywhere. While 1 Sleep(1000000) WEnd Func _OpenText() Run(@ComSpec & ' /c "' & $hTxtFile & '"', '', @SW_HIDE) EndFunc Func _EXITNOW() Exit EndFuncSmOke_N, I tried to use the Run command, but I forgot about @ComSpec which I have used in past programs. I guess I should have read the help file more closely again. It has been a long day. Thanks again. taurus905 "Never mistake kindness for weakness."-- Author Unknown --"The highest point to which a weak but experienced mind can rise is detecting the weakness of better men."-- Georg Lichtenberg --Simple Obfuscator (Beta not needed.), Random names for Vars and Funcs Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now