App to Uncomment Scripts

If you are currently developing portable freeware or planning to do so, use this forum to discuss technical implementation, seek out like-minded developers for partnership, or solicit interested users for beta testing.
Post Reply
Message
Author
User avatar
Napiophelios
Posts: 569
Joined: Sun Mar 01, 2009 5:48 pm

App to Uncomment Scripts

#1 Post by Napiophelios » Sat Jun 12, 2010 12:04 am

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: Select all

http://www.mediafire.com/file/nm1gknzmwky/NO 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. :)

User avatar
Napiophelios
Posts: 569
Joined: Sun Mar 01, 2009 5:48 pm

Re: App to Uncomment Scripts

#2 Post by Napiophelios » Sat Jun 12, 2010 1:01 pm

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

Post Reply