Jump to content

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

Toggle between two links/programs on my computer



  • Please log in to reply
3 replies to this topic
garret27
  • New members
  • 2 posts
  • Last active: Oct 06 2015 11:49 PM
  • Joined: 04 Oct 2015

I really love this  program. I am trying to make a script that would toggle between two link/programs, but I can't seem to figure this one out. Something like this:

*Launch_Mail:: 
  toggle:=!toggle ;
  if toggle
    Run, "C:\Hotkey Commands\Triple Monitors.lnk"
  Else
   Run, "C:\Hotkey Commands\TV Monitor.lnk"
return


boiler
  • Members
  • 252 posts
  • Last active: Nov 07 2015 09:39 PM
  • Joined: 04 Jun 2014
Try it without the quote characters. When you see stuff in quotes in the examples of the Run command, that is for parameters to be passed that need to be in quotes.

garret27
  • New members
  • 2 posts
  • Last active: Oct 06 2015 11:49 PM
  • Joined: 04 Oct 2015

Heh, so that worked. I have been using autohotkey for a while and I winged that code there, doubting that it would work, seeing if more experienced people knew how to make such a script. Doubted my own abilities :)



Lexikos
  • Administrators
  • 9844 posts
  • AutoHotkey Foundation
  • Last active:
  • Joined: 17 Oct 2006
✓  Best Answer

The quote marks should make absolutely no difference in this case.  Are you sure it wasn't just saving/reloading the script that fixed it?  Maybe some other coincidence...

 

If you write Run, C:\Program Files\Some App\App.exe, it's possible that C:\Program.exe or C:\Program Files\Some.exe could be executed, if they exist. Adding quote marks eliminates this ambiguity.