as : when i type hello world
call hello hot string and pass world as parameter. i can pass any word in place of world
Code: Select all
::hello::
xyz(%1%)
{
msgbox %1% //show in message world
}
return
Code: Select all
::hello::
xyz(%1%)
{
msgbox %1% //show in message world
}
return
Code: Select all
::hello::
xyz(Trim(A_ThisHotkey,":"))
return
xyz(in)
{
msgbox %in% //show in message world
}
Code: Select all
Global MyArray:={"hello":"world","btw":"AutoHotkey"} ; associative array
::btw::
::hello::
xyz(MyArray[Trim(A_ThisHotkey,":")])
return
::bye:: ; regular hotstring
xyz("Goodnight")
Return
xyz(in)
{
msgbox %in%
}
Code: Select all
HelloText=%1%
::hello::
xyz(HelloText)
return
xyz(in)
{
msgbox %in%
}
Code: Select all
::open::
open(nextstring)
return
open(nextstring)
{
run %nextstring%.exe
}
Code: Select all
::open::
Input,nextstring,,{Enter}
Run,%nextstring%.exe
return
If you truly need the script not to do anything until after you type "open notepad " then you might look into Dynamic Hotstrings. It is a script somewhere on the forums that allows you to use RegEx patterns as hotstrings and you can make what you seem to want work very much like a normal hotstring without having to type invisible or bring up a input box.GS SAHU wrote:i want to write a script.
when i type.
open notepad , open wordpad , open paint, open cmd
script like thatCode: Select all
::open:: open(nextstring) return open(nextstring) { run %nextstring%.exe }
Code: Select all
; enter your argument | Parameter left or the trigger string
; Ctrl + Left Arrow moves the curso to the beginning of the previous word
Send ^{Left} ; send Ctrl + Left error - goes to begning of word to the left
Send {Shift down} ; hold shift down
Send ^{end} ; select to end of line
Send {Shift up} ; shift up
tempClip := clipboard ; save the current clipboard stuff (text anyway)
clipboard := ""
Send ^{x} ; copy to the clipboard
ClipWait ; wait for the clipboard to have stuff
my_word := Clipboard
clipboard := tempClip
msgbox, % "My word is " my_word
Users browsing this forum: -Elaphe-, downstairs, Frogrammer, Google [Bot] and 232 guests