AutoHotkey Community

It is currently May 27th, 2012, 11:51 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: August 30th, 2010, 7:04 pm 
Offline

Joined: December 20th, 2005, 7:14 pm
Posts: 61
how do i execute a command inside a variable? eg

myvar="sendinput hi there"

how would i run the commands within myvar?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 30th, 2010, 7:06 pm 
Offline

Joined: May 27th, 2007, 9:41 am
Posts: 4999
One way http://www.autohotkey.com/forum/topic25867.html
(another way as described in that thread as well is: save var to new ahk file and run that ahk script)

_________________
AHK FAQ
TF : Text files & strings lib, TF Forum


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 30th, 2010, 7:07 pm 
Offline
User avatar

Joined: November 2nd, 2008, 4:23 pm
Posts: 2906
Location: 127.0.0.1
Edit: Hugov beat me to it :D
You can look at Run Dynamic Script...Throug a Pipe. Also you can pass a variable to the command. Example:
Code:
TextToSend = This will be sent...
SendInput %TextToSend%

_________________
aboutscriptappsscripts
Any code ⇈ above ⇈ requires AutoHotkey_L to run


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 30th, 2010, 8:32 pm 
Offline

Joined: February 17th, 2008, 5:01 pm
Posts: 303
I use a modified version of:
http://www.autohotkey.com/forum/viewtopic.php?t=3332

It can't handle arbitrary code like other methods can (it uses a very small but powerful subset of the language), but it's super fast.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], BrandonHotkey, MSN [Bot], Yahoo [Bot] and 16 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group