AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

calling a script within an other script.

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
nicklorion



Joined: 03 Jul 2008
Posts: 4

PostPosted: Thu Jul 03, 2008 1:09 pm    Post subject: calling a script within an other script. Reply with quote

I've searched the forum but i cant find it maybe im using the wrong search variables... sorry nontheless

i was wondering if its possible to call a script in another script
for example:

Code:
test:
msgbox this is a test
return


now i want to call the above script in a new script for example

Code:
#q::
call script: test
return


how can i do this?

Kind regards Nick
Back to top
View user's profile Send private message
GodlyMario



Joined: 02 Jul 2008
Posts: 39

PostPosted: Thu Jul 03, 2008 1:36 pm    Post subject: Reply with quote

Include
or
Run, c/folder/test.ahk
Back to top
View user's profile Send private message
nicklorion



Joined: 03 Jul 2008
Posts: 4

PostPosted: Thu Jul 03, 2008 1:47 pm    Post subject: Reply with quote

its in the same file for example:
Code:

test:
msgbox this is a test
return


#q::
call script: test
return
Back to top
View user's profile Send private message
tonne



Joined: 06 Jun 2006
Posts: 1259
Location: Denmark

PostPosted: Thu Jul 03, 2008 1:54 pm    Post subject: Reply with quote

Code:
Gosub, Label1
MsgBox, The Label1 subroutine has returned (it is finished).
return

Label1:
MsgBox, The Label1 subroutine is now running.
return

_________________
there's a dog barking close within the range of my ear
sounds like he wants to escape the chain
he would probably bite me to death if he could
but the chain lets me spit in his face

- Kashmir
Back to top
View user's profile Send private message
nicklorion



Joined: 03 Jul 2008
Posts: 4

PostPosted: Thu Jul 03, 2008 1:57 pm    Post subject: Reply with quote

Sorry i dont get it,
how do i call it with a key combo?

windows + q for example
Back to top
View user's profile Send private message
tonne



Joined: 06 Jun 2006
Posts: 1259
Location: Denmark

PostPosted: Thu Jul 03, 2008 2:25 pm    Post subject: Reply with quote

This works
Code:
#q::
gosub, test
return

test:
msgbox this is a test
return


Better read up on Auto-Execute section.
_________________
there's a dog barking close within the range of my ear
sounds like he wants to escape the chain
he would probably bite me to death if he could
but the chain lets me spit in his face

- Kashmir
Back to top
View user's profile Send private message
nicklorion



Joined: 03 Jul 2008
Posts: 4

PostPosted: Thu Jul 03, 2008 2:30 pm    Post subject: Reply with quote

ahh thnx thats what i needed
again thanks allot
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group