Remote Action: Major Update! (Start Applications Remotely with Dropbox and Autohotkey)
Autor: César Brasil | Publicado: 2010-05-31T16:54:00-03:00




Update [June 1st, 12 pm Brazil time (GMT-3)]:&nbsp;Just wrote a script that will create your dummy.ahk script hassle-free and save it on My Dropbox folder, alongside the remoteAction.ahk script. Download it here.&nbsp;Leave this running on your local PC (place it on your startup folder to make things real simple) and whenever you want to create an action to be performed remotely, just press Ctrl+Win+A and type your Autohotkey command on the displayed window. Hit OK and your dummy.ahk script will have been created with that content. A couple of things to remember: Before using it, you must check the makeDummy.ahk script to see if your My Dropbox folder path is correct. If not, edit and overwrite it. Another thing is replacing the custom action list with your own, never forgetting to write it all in one line and indicating new lines with `,`; (exactly as typed). If you are curious and wish to know what the script looks like before you download it, here it is:








^#a::Gui, 22:Add, Text,, Type remote action to send.`nAll actions must be compatible with AHK scripting.Gui, 22:Add, Edit, r22 W500 vMyEdit22remote, `;Run, notepad.exe`n`;Run, http://twitter.com/brasildeluna`n`;MsgBox, Call me right away!Gui, 22:Add, Button, default, OKGui, 22:Show,, Remote actionreturn22GuiEscape:22GuiClose:&nbsp;&nbsp; Gui, Destroyreturn22ButtonOK:&nbsp;&nbsp; GuiControlGet, MyEdit22remoteGui, Destroyif ErrorLevel&nbsp;&nbsp; &nbsp;Sleep, 0&nbsp;&nbsp; &nbsp;FileAppend, %MyEdit22remote%, C:\Dropbox\My Dropbox\AHK\dummy.ahk ;Return












Just last week I posted a simple solution I had come up with for launching apps remotely using only Dropbox and Autohotkey. A few days later, my idea was posted by Whitson Gordon at Lifehacker.com, probably the best tech website ever, and&nbsp;definitely&nbsp;my all time favorite.
With over 12.000 page views and hundreds of tweets, commenters gathered around this very simple idea and made it bigger, better and awesomer!

And so, what started out as a simple script that reloaded itself every 5 minutes and had to be edited a couple of times to work, now looks like this (download it here):

FormatTime, CurrentDateTime,, yyyy.MM.dd.HH.mm.ss&nbsp;IfExist, dummy.ahk{Run, dummy.ahkSleep, 1000FileMove, dummy.ahk, remoteAction_ran/%CurrentDateTime%_dummy.ahk}Sleep, 300000Reload

What it does now is much more than just reload itself. In fact, this script doesn't even have to be touched anymore, like it had to in my original post.
All you gotta do now is place this script in My Dropbox folder and create a shortcut to it on your remote computer's Startup folder. Whenever you want to send any Autohotkey action to your remote computer, just create a script called "dummy.ahk" (without the quotes, of course) and save it too on My Dropbox folder, alongside the script above.
What's gonna happen is that the original script will keep reloading itself every five minutes, and when it does, it'll check to see if there's a script called "dummy.ahk". If there is none, nothing will happen. However, if it is found, the dummy script will be run and moved to a&nbsp;sub-folder&nbsp;called "remoteAction_ran" (you may have to create this&nbsp;sub-folder&nbsp;yourself). Moreover, it will be renamed to include the exact date and time the script ran.&nbsp;
This is a great way to not only send actions to your remote PC, but also to keep track of what's been done and when.
Here are a few examples of what "dummy.ahk" scripts could look like:

MsgBox, Mom, call me right away, I forgot our home number again!Return

This will send an alert to whomever is using your remote PC at the moment.

Run, auto.batReturn

This will run a batch file lying in My Dropbox folder.

Shutdown, 1&nbsp;Return

This will remotely shutdown your computer


Run, C:\Program Files\LogMeIn\x86\LogMeIn.exeReturn

This will run an application remotely. Is this example, I'm launching LogMeIn.
The possibilities can really take you as far as your mind can go.
A "Thank you very much" to Whitson Gordon at Lifehacker.com, to all the great commenters out there who made great advances to my original script and to everyone who enjoyed this solution I came up with last week. Also, to everyone that tweeted my blog post and the Lifehacker post. I am very&nbsp;grateful&nbsp;to have been featured on such a magnificent website. I truly thank you all.
- César