Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Can I launch a hotstring on one script from another script?


  • Please log in to reply
2 replies to this topic
shadowAhk
  • Members
  • 5 posts
  • Last active: Sep 16 2006 01:33 AM
  • Joined: 15 Sep 2006
Hi all,
I have been addicted to autohotkey since I first learned off it a few weeks ago :lol:. I am running the excellent Autoclip script to hold a few scripts that I like to launch when I enter certain hotstrings, mostly to log into websites. I want to keep using it as it does its job perfectly, allowing me to add and remove things as needed quickly. Now I want to also be able to call this hotstrings from another script. For example, if in Autoclip I have a tiny script so that when I enter something like logSite, will send to the page my username{tab}password{enter}. I want to write another script that with a hotkey will launch the website, wait for it to load and then send the string logSite to the page, which in turn would launch the autoClip script and log me in. This would allow me to keep my log in type stuff in autoClip where it belongs, and my page launching code in my own custom script. Unfortunately, after searching for a bit, it seems like this is not possible?? :shock: Any ideas? :?:

Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004
A script cannot trigger the hotstrings in some other script via the Send command. However, it can use the Send command to trigger non-hook hotkeys in some other script (you can find out whether a hotkey is "non-hook" by using the ListHotkeys command or menu item).

You can also use other methods to communicate between scripts. For example, there is an example on the OnMessage() page of how to send and receive messages between scripts.

shadowAhk
  • Members
  • 5 posts
  • Last active: Sep 16 2006 01:33 AM
  • Joined: 15 Sep 2006
Gotcha, in that case I think it will be easier to just copy the hotstrings into my custom script, but that onMessage will be definitely come in handy when I need to get multiple scripts talking to each other.

Thank you sir!