AutoHotkey Community

It is currently May 27th, 2012, 1:16 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: August 30th, 2005, 8:11 am 
Offline

Joined: May 26th, 2004, 12:20 pm
Posts: 61
Hi,

Several months ago I posted this:

http://www.autohotkey.com/forum/viewtopic.php?t=2148

My /S solution worked fine; however since then I've upgraded, trashed my computer, reformated, reinstalled Windows (twice), and am now in the process of re-setting everything up how I wanted it in the first place! I, of course, forgot to back up my source changes...

If its quick and easy (I seem to remember it was), would it be possible to add a /S and/or -S (or similar) parameter which can be supplied to AutoHotKey on the command line that makes it skip the very first line of a script that it loads?

Thanks loads,

Ant.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 30th, 2005, 12:07 pm 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
Quote:
...add a /S and/or -S (or similar) parameter which can be supplied to AutoHotKey on the command line that makes it skip the very first line of a script that it loads
It's easy to add. The only problems are:

1) The risk of breaking existing scripts that already use /s as an incoming parameter. The parameter could be made longer to reduce the risk of this.

2) Adding features to the program that would be used by fewer than 1 out of 1000 of its users is hard to justify, even if the code size is small. This is because it affects the size of every compiled script, as well has having a tiny impact on performance (code size affects memory utilization, which in turn affects performance). While both of these impacts are tiny, they really add up as more of such features get added over time.

I'm not saying it won't ever be done, I'm just expressing reluctance. Compiling a customized version of the program for this purpose would be ideal, but I realize it might not be practical for you.

Maybe others have comments.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 2nd, 2005, 10:50 am 
Offline

Joined: May 26th, 2004, 12:20 pm
Posts: 61
Hi Chris,

I totally agree; both of those points make perfect sense. However, I'll keep patching the source myself, and just in case anyone else would find this functionality useful, as long as you don't mind, I'll make the patch + a patched executable available here.

Thanks for the great product, and keep up the good work!

Ant.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 2nd, 2005, 1:15 pm 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
Alternate versions are quite welcome. Thanks for making it available to others.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 12th, 2005, 4:47 pm 
Offline

Joined: May 26th, 2004, 12:20 pm
Posts: 61
Hello,

Just in case anyone is interested in this, I've started to implement this in a different way. Instead of requiring a -s or /s or /skip parameter to skip the first line, my patched AutoHotkey.exe now explicitly looks out for a shell command hint on the first line, and if it finds it the first line is skipped.

(Details: if the first two bytes of the file are #! and the first line doesn't contain a double colon ::, its considered to be a shell command hint).

This means I can run the same script by either double clicking it or just typing its name on the Cygwin command line.

Hope someone else finds this useful.

Ant.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group