|
3
|
DonationCoder.com Software / Finished Programs / Re: SOLVED: convert html tags/attributes to lowercase
|
on: September 03, 2012, 08:31:27 AM
|
|
Thanks for the tip. Unfortunately, has no executable for Windows 7, and unfortunately is no longer supported. One can check out the source code, if one happens to have a compiler handy, I guess.
Komodo IDE (hundreds of bucks) has one, and also there are macros for Komodo Edit 7 (free).
If I get around to writing this app I'll post it here.
|
|
|
|
|
4
|
DonationCoder.com Software / Finished Programs / SOLVED: convert html tags/attributes to lowercase
|
on: September 02, 2012, 11:59:05 AM
|
|
The problem I need to solve is this: I have lot of books that I have typeset in Framemaker 5.5.6, Pagemaker 7, or Word format. I need t o convert them to e-books: mobi, epub, etc format. I will be using calibre.exe for the conversion. E-book source is always in html. I want to use proper html/css programming so that there is a uniformity to the look & feel of the e-publications.
All of the word processing apps have an “export to html” function. Trouble is, the output html is all upper case, e.g., <P ALIGN="center">. I like to code web pages so that they comply with xhtml 1.0 strict, which means no upper case tags or attributes, among other things. (No ALIGN attribute, for instance!)
I have in mind a little app that would rest on the desktop, that I could drag and drop a file onto. Something like the good old DOS2UNIX.exe that converts line endings from CRLF to LF. No GUI, in other words.
I have started working on a little autohotkey app, but I''m not so skilled. (If someone would just help me with the code, I would be very grateful!) The code I have so far is copied below, but I consider it to be pseudocode rather than actual code.
BTW, this is exactly the type of app that is best written in assembler, because it's so simple. Why didn't anybody think of it before? --Google searches don't even come close.
Logic, in brief: Set a couple of boolean variables to false, and a pointer to 0 Scan through the file byte by byte looking for "<" ** NOTE If found, go into conversion mode, lowercase everything if converting, and next character is " quote mark, temporarily stop converting on second " quote mark, resume converting until ">" is found until EOF
** Since the source file is output from a word processor, all instances of “<” etc are automatically converted to their html codes < etc, so any “<” encountered will have to be the start of an html tag.
------------------------------------ code follows
; maxmem default = 64 MB. Inputfile must be less than 64MB
filecopy, test-case.html, test-case.bak, 1 ; overwrite any existing bak file filegetsize, FSize, test-case.html ; test-case.html is my test file ; msgbox, "Size is "%FSize%
Ptr = 0 ; pointer to character position in BigStr InMarkup = 0 ; false QuoStr = 0 ; false TChar = ; temp char to hold bigstr character
fileread, BigStr, test-case.html FSize := StrLen(BigStr) ; msgbox Outside loop. Filesize: %FSize% Ptr: %Ptr% ; for debugging if not errorlevel { ; msgbox Not errorlevel ; for debugging loop while (%Ptr% < %FSize%) { msgbox In loop while... ; for debugging if (InMarkup) { if (!QuoStr) { if (TChar >= "A" && TChar <= "Z") { BigStr%Ptr% := %TChar%+32 } if (TChar==34) { QuoStr:=1 } if (TChar= ">") { InMarkup:=0 } } if (TChar==34) { QuoStr:=0 } } else { if (TChar = "<" && BigStr%Ptr%+1<>"!") { InMarkup:=1 } } Ptr:=%Ptr%+1 } } FileDelete, test-case.html FileAppend, %BigStr%, test-case.html BigStr = ; Free the memory.
------------------------------------ code ends
|
|
|
|
|
5
|
DonationCoder.com Software / Screenshot Captor / Re: What is the best image format to save screenshots from desktop programs?
|
on: June 30, 2010, 09:20:46 AM
|
PNG, converted to 256 colors *without* dithering. Disable background images before taking screenshot. This dithering/anti-aliasing thing is a problem. When creating images for print presentation, dithering causes unwanted effects in the final output. This occurs in any area on the graphic that has a smooth blend of colors, such as Dark-blue fading to Light-blue, as in title bars on dialog boxes in Win 2K, or the 3D ("plastic") title bar in Win XP and beyond. For regular photographs, this presents no problem. But for screen captures of dialog boxes with text areas, the output is not so good when viewed onscreen, and still worse when printed. You end up with moiré patterns. The effect is also pronounced in text. Anti-aliasing creates a very fuzzy outline. To get a non-dithered image, save it as a PNG, at 256 colors, as mentioned by f0dder above. You can also save it as a GIF with the same format. Or even BMP. The PNG can be marginally smaller than GIF. But some older page formatting software can’t handle PNG. To get non-aliased text, turn off the “smooth edges of screen fonts” in My Computer > Properties > Advanced > Settings. And in Display Properties > Appearance > Effects, un-check the “use the following methods to smooth screen fonts.”
|
|
|
|
|
6
|
DonationCoder.com Software / Screenshot Captor / Re: LATEST VERSION INFO THREAD - ScreenshotCaptor -2.82.01 - June 1st, 2010
|
on: June 30, 2010, 08:11:22 AM
|
Love this app! I don’t know if this is a bug, but. . . All my screen caps are dithered. The colors on captured image kind of blend into the surrounding color. I think this is called “anti-aliasing”. And blended colors are often dithered with random nearby pixels set to another, similar color. Well, this is OK for onscreen viewing, I suppose (I don’t care for it, though), but it makes for very fuzzy images when they are used for print. I’m creating a help manual that will be delivered in PDF format which will enable it to be both printed and viewed onscreen. In any kind of zoomed view, the graphics are not sharp. How can I turn off the anti-aliasing and dithering features in order to get a sharp image for print reproduction? (BTW I have dithering turned OFF in IrfanView.) Thanks, HarryG
|
|
|
|
|
7
|
DonationCoder.com Software / Post New Requests Here / ”run and hide” function for MS Office shortcut bar
|
on: May 11, 2010, 09:52:02 PM
|
|
I find the use of a shortcut bar, even with lots of submenus, much faster to navigate than the Start menu. I use old MS Office (97) shortcut bar.
Being greedy for desktop space (because I often have a half-dozen or more apps up and running, I have formerly put the Office shortcut bar into the title bar area. Even so, this blocks the control buttons on some windows or the extended information in the title bar in others.
If I simply hide the shortcut bar, I'm always tripping it when I run the cursor to the top menu of an app.
Could that nifty run-and-hide macro be modified to hide/restore the MS Office Shortcut bar?
I would be ever so grateful!
-Harry
|
|
|
|
|
10
|
DonationCoder.com Software / Post New Requests Here / Silent msgbox() popup in VBA for Word
|
on: May 06, 2010, 09:08:43 AM
|
|
I write lots of VBA applications in the course of my work. Often I use a msgbox() function, with buttons Yes, No, Cancel, to get a 3-way selection, e.g.,
Select case msgbox("Are you Hot (yes), Cold (no), or Lukewarm (cancel)", VBYesNoCancel) case vbyes : <some code> case vbno : <some code> case vbcancel : <some code> end select
Trouble is, looping through a long document causes the message box to pop up dozens of times, severely annoying my co-workers and driving me crazy.
I know I can turn off the notification sound in the Control Panel. How about writing a little app that could be called from VBA, that would turn on/turn off the sound? My VBA code would then look like this:
x = shell ("c:\utils\soundoff.exe off") < a little timer delay > messgebox ( ) parsing x = shell ("c:\utils\soundoff.exe on")
The shell function in VBA returns a value, 0 if no problem, or the program ID otherwise, which is why I have the dummy parameter variable x.
One can set/reset the sounds in the registry, but I wonder if it is tempting fate to write/rewrite the registry...
How about simply muting the speakers for a moment while the messgebox come up?
BTW I'm running Windows XP HE, but I have Vista and 98 also.
Thanks!
|
|
|
|
|
13
|
DonationCoder.com Software / Finished Programs / Re: IDEA: Faster boots combining hibernate and restart (Boot Snooze)
|
on: March 10, 2010, 08:27:13 PM
|
|
Mouser, thank you for the program; nonetheless it is absolutely useless (for me) as is. Here’s what I normally do (without boot snooze).
Press Windows, then U, then H. (I then walk away and forget it.) Or, to shutdown completely, Win, U, S. Or, to restart, Win, U, R.
What I want to do using bootsnooze: Press Windows, U. The Logout screen appears. Press Z (or some other hotkey): The boot snooze operation begins, and I can walk away and forget it.
None of this having to wait for the login screen, logging in, THEN selecting Hibernate. Heck, I can do the same thing much faster from the keyboard! (Type Win, U, R, then wait for the login screen; then click Turn Off, followed by H. Don’t even need to log in.)
|
|
|
|
|