One way would be to "RemoteControl" Second.ahk from inside First.ahk, using
onMessage() and
SendMessage
Example:
Code: Select all
; First.ahk
DetectHiddenWindows, On
SendMessage, 12345,,,, R:\Temp\Second.ahk ; this remotely controls a script
Code: Select all
; Second.ahk
OnMessage(12345, "RemoteControl")
return ; end of auto-execute section
;-------------------------------------------------------------------------------
Foo: ; some label
;-------------------------------------------------------------------------------
MsgBox,, %A_LineFile%, Line %A_LineNumber%: %A_ThisLabel%
return
;-------------------------------------------------------------------------------
RemoteControl() { ; remote control this script
;-------------------------------------------------------------------------------
goSub Foo
}
I hope my simple example helps you to get started.