Local $project = "Compound";This will open up a project and compile it. You may want to change the c:\games\inform directory, or the project name, but I hope the code makes intuitive sense. The CmdLine stuff basically says I could try ide.au3 threediopolis or ide.au3 fourdiopolis or, better yet, theshortcut ide.au3 3d, if I wanted. Awkward code, but I'm too lazy to read if hashes are a Thing in AutoIt, and what I have works.
if $CmdLine > 0 Then
$project = $CmdLine;
if $CmdLine == "pc" Then
$project = "Compound";
if $CmdLine == "3d" Then
$project = "threediopolis";
if $CmdLine == "4d" Then
$project = "fourdiopolis";
run("C:\\Program Files (x86)\\Inform 7\\Inform7.exe");
WinWaitActive("Welcome to Inform 7");
WinWaitActive("Open a project");
Send("c:\games\inform\" & $project & ".inform!O");
WinWaitActive($project & ".inform - Inform");
It's handy for me as it'd be nice to be the first thing to see in the morning, so I do that instead of silly internet browsing. Or if you edit outside the IDE (I use notepad++), pushing the button here can work.
You can obviously tweak this to check for if a window is already open, but this basic script says: build every night, and have the IDE open when you get started.
A script like this may not be profound in itself, but it certainly starts things right. Now I've done it, I feel like I should have a few years ago. These things seem like they only save a few seconds, but when they're more convenient than accessing a time wasting website, they can save a lot more time.
(Note: this was updated for ide.au3 to allow a command line argument as well as shortcut text)
Post a Comment