It is currently Mon Apr 27, 2015 1:00 pm

All times are UTC - 8 hours

Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: App to Uncomment Scripts
PostPosted: Sat Jun 12, 2010 12:04 am 
User avatar

Joined: Sun Mar 01, 2009 5:48 pm
Posts: 530
Location: Charleston,SC.
Place the script to be edited in the dropbox folder and run the EXE.
The app will create a backup copy and place it in the Backups folder
it will then remove all lines in the script that START with a " ; " and produce an edited script named "_reduced.nsi"
it will then automatically open the new script in the default program for nsi files (which is Notepad2 for me).

Code: Comment.7z

Problems so far Stuff I need help with :) :

only one script at a time.
If multiple scripts are present it will edit the first one attained
alphabetically and simply copy the rest to the Backups folder.

If there is space in front of the comment symbol it is not interpretted as a comment and will be skipped.
Thus if a comment is located in the middle of a line of text it goes unedited.
We need it to clear the rest of the line from wherever the symbol is located in the line...
whether its the first character or not.

Also because of the way lines are currently removed,large gaps are left in the script.
NSIS text replace (as far as I can find in my research) doesnt allow for replacing "spaces"
and I can only designate one symbol as a comment indicator (AFAIK).

I would like for it to reduce multiple blank lines to a single blank line and also use " \ " and " # "
as comment indicators or have some sort of config ini for the user to enter their own selections for this.

The use of a "DropBox" folder is a work around for my lack of knowledge about NSIS scripting in general.
An "input" and "output" name is required for the script to work as its currently written.

So this app is actually 2 little programs working together,
one that copies and renames files in the DropBox and the other
that works from the temp folder to do the actual editing.

It would be optimal to be able to just drag and drop files onto the exe and do away with
the DropBox folder altogether.

And having the app simply add the "_reduced" tag to the end of the original file name wouldnt be bad either.

I have seen some of Crownixx's AutoIT programs that do this but I know even less about AutoIT
"ConTEXT Editor" also uncomments lines beautifully...unfortunately thats the only thing I reallly find appealing about it.I dont want another text editor hanging around for no other reason than to tidy up my messes.
I really am trying for a small exe with this one function that would ideally work with a shortcut in the send to folder

Having the file open when complete can be done away with,
its only purpose is to make renaming (and editing the blanks) a little quicker.

I have included the nsis scripts for recompiling the NoComment EXE
I welcome anyone to edit and improve on this...just be sure to share any progress you make.
Any help sorting/fixing these things is much appreciated....but please dont limit your solutions to NSIS scripting.
If you know of a lightweight program specifically for such actions or if you know how to do this in some other script language ,let me know :)

Thanks in advance. :)

"Defects are always more tolerable than the changes necessary to correct them"

PostPosted: Sat Jun 12, 2010 1:01 pm 
User avatar

Joined: Sun Mar 01, 2009 5:48 pm
Posts: 530
Location: Charleston,SC.
Allright here's version 2.

Download NoComment_v2

App will now uncomment all nsi files found in the app directory
Backup copies of all nsi files found will be copied to a Backup folder
before processing.

-Now Handles Multiple files at once
-Now uncomments segments located "mid-sentence" (not just lines starting with a comment symbol)
-Large segments of blank lines reduced (but not completely done away with)

The great improvements are from the AutoIT script written by TommyTom @ S.R.N.
Here is an earlier version of the app without the NSIS wrapper.
No Comment v2_AU3

"Defects are always more tolerable than the changes necessary to correct them"

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 8 hours

Who is online

Users browsing this forum: No registered users and 3 guests

You cannot post new topics in this forum
You cannot 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:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group