Flo’s Great Remove All Empty Lines Regex

December 8, 2007 on 3:31 pm | In Notetab Clips | No Comments

If a file has a return on the last line of text followed by the file end assertion, it will not remove that extra return if you are searching for empty lines. This regex does the trick:

^!Replace “\R(?=\R)|\A\R|\R\z” >> “” AWRS

Note per Sheri: \z is an assertion for the position of end of the file. It has a width of zero characters. Ditto for \A, \Z, \z, ^ and $.

Notetab Clip to Make Tab Delimited File into Comma Separated Value CSV File

December 6, 2007 on 12:08 pm | In Generic Clips, Notetab Clips | No Comments

This clip makes a file into a comma separated value file if it is say tab delimited at the start. It offers several choices of delimiters to start including comma, semi-colon, colon, tabs, etc.

EPOCH Time from System Time Using Notetab Clip

April 15, 2007 on 6:53 pm | In Generic Clips, Notetab Clips | 1 Comment

I want to do a time comparison between two times. I figured a good way to do that might be to generate a Unix or EPOCH time as is commonly used in Perl, PHP, and many other programming languages. I searched help and help on clip programming and did not find any reference to EPOCH time in either, so I decided I was on my own.

My method is set out in the beginning of the clip in a comment. I did take into account leap years (skipping over the issue that ever other century or so you skip a leap year even though the year is divisible by four…or something like that). I think it is working. I may in my next go let you set a random time. Currently this is outputting most interim data calculated, but I obviously would modify that for a final product.

Here is the NoteTab Pro Clip to generate EPOCH time from the system time. You can check your results using an EPOCH to human time converter.

;*** Effort by Don Passenger
;*** don at htmlfixit dot com
;*** Creates EPOCH Time (seconds since Jan 1, 1970 to current)
;*** from time on computer
;*** copy posted at:
;*** http://htmlfixit.com/blog/?p=356
;*******************************************************
^!InsertText +++++++++++++++++get date off system++++++++++++++++++++++^P
:GrabDates
;get year
^!Set %year%="^$GetDate(yyyy)$"
;get month (no leading zeros)
^!Set %month%="^$GetDate(m)$"
;get days (no leading zeros)
^!Set %day%="^$GetDate(d)$"
;get hours (no leading zeros)
^!Set %hours%=^[h^]
;get minutes (no leading zeros)
^!Set %minutes%=^[n^]
;get seconds (no leading zeros)
^!Set %seconds%=^[ss^]

:FigureEpochTime
;Method Used:
;base year (from Jan 1 70 to Jan 1 2007)
;+ seconds in each year after 2006
;+ seconds in each month in current year
;+ seconds in days up to today
;+ seconds in hours, minutes, seconds of today
;I disregard leap seconds and figure I'll
;be dead before the next non-leap year
;divisible by four

:CalculateSecondsInYearsFrom2006
^!InsertText ++++++++++++++calc seconds in years after 2006++++++++++++++++++^P
;calculate days in years between 12/31/2006
;and current year (whole years only)
^!Set %baseyear%="2006"
^!Set %numberofyears%="^$Calc(^%year%-2006-1)$"
:Loop_years_to_seconds
^!Set %counter%="0"
^!Set %secondsinyears%="0"
;skip years entirely if is currently 2007
^!If ^%numberofyears% = 0 Loop_months_to_seconds

:next_year
;first time thiw becomes 2007 and then it
;counts up to current year
^!Inc %baseyear%
;set days in month for non-leap years
^!SetArray %daysinmonth%=31;28;31;30;31;30;31;31;30;31;30;31
;determine if year being worked on is leap year
;fix Feb days if yes
^!If ^$calc(^%baseyear% mod 4)$<>0 Skip
^!Set %daysinmonth2%=29

:calcsecondsinyears
;abort any time we are out of whole years 2007-
^!If ^%numberofyears% = 0 Loop_months_to_seconds
;in counter so that we can get days in each month of year
^!Inc %counter%
;add to seconds in year the active month in the active year
^!Set %secondsinyears%=^$Calc(^%secondsinyears%+(^%daysinmonth^%counter%%*86400))$
;this is just for testing to show the output after each month
;while calculating the active year
^!InsertText ^%secondsinyears% to ^%baseyear%-^%counter% ^$Calc(^%secondsinyears%+1167609600)$^P

;do the next month in active year unless we are at 12 (ie no more months)
^!If ^%counter% <> 12 calcsecondsinyears
;reduce years to be calculated by one and recycle to calc seconds in next year
^!Dec %numberofyears%
;reset month counter to zero
^!Set %counter%="0"
;goto next year 2008-
^!Goto next_year

:Loop_months_to_seconds
^!InsertText ++++++++++++++++++calc seconds in whole months of current year++++++++++++++++^P
;calculate days in whole months for current year
;set the months to 0 so we can process each month
^!Set %basemonth%="0"
;start the base counter
^!Set %secondsinmonths%="0"
;get us out of here if it is Jan
^!If ^$Calc(^%basemonth%+1)$ = ^%month% Loop_days_to_seconds
;set months array for non-leap years
^!SetArray %daysinmonth%=31;28;31;30;31;30;31;31;30;31;30;31
;if current year is leap year, correct Feb
^!If ^$calc(^%year% mod 4)$<>0 Skip
^!Set %daysinmonth2%=29

:next_month
;start with month 1 (Jsn first time and increas by one each time)
^!Inc %basemonth%
;if it is current month we are done with months
^!If ^%basemonth% = ^%month% Loop_days_to_seconds

:calcsecondsinmonths
;do math to get seconds in current month and add to prior months we calculated
;on previousl iterations of this
^!Set %secondsinmonths%=^$Calc(^%secondsinmonths%+(^%daysinmonth^%basemonth%%*86400))$
;insert text is just for testing so we can see we are where we belong at the end of
;each successive month of calculation
^!InsertText ^%secondsinmonths% to Month-^%basemonth% ^$Calc(^%secondsinmonths%+^%secondsinyears%+1167609600)$^P
;repeat until we hit current month (tested above)
^!Goto next_month

:Loop_days_to_seconds
^!InsertText +++++++++++++++++++++calc seconds for whole days current month+++++++++++++++++^P
;set base variable for calculation of seconds in whole days in current month
^!Set %baseday%="0"
^!Set %secondsindays%="0"

:next_day
;increment baseday to 1 first iteration and increasing on each pass
^!Inc %baseday%
;get us out of here when no more full days left to calc
^!If ^%baseday% = ^%day% Loop_hours_to_seconds

:calcsecondsindays
;do math adding second for active day to prior whole days of seconds in current month
^!Set %secondsindays%=^$Calc(^%secondsindays%+86400)$
;insert text just for testing to see if we are where we belong
^!InsertText Current Month Day-^%baseday% ^$Calc(^%secondsindays%+^%secondsinmonths%+^%secondsinyears%+1167609600)$^P
;repeat until we are out of whole days in current month (tested above)
^!Goto next_day

:Loop_hours_to_seconds
^!InsertText +++++++++++++++++++++++Calc Whole Hours Today to Seconds++++++++++++++++++++++++++++++^P
;calculate seconds in whole hours today
;set the hours to 0 so we can process each one
^!Set %basehour%="0"
;start the base counter
^!Set %secondsinhours%="0"
;get us out of here if it is < Midnight+1hour
^!If ^$Calc(^%basehour%+1)$ = ^%hours% Loop_minutes_to_seconds

:next_hour
;start with hour 1 (12:00:01am first time and increase by one each time)
^!Inc %basehour%
;if it is current month we are done with months
^!If ^%basehour% > ^%hours% Loop_minutes_to_seconds

:calcsecondsinhours
;do math to add 3600 seconds to total for this hour
^!Set %secondsinhours%=^$Calc(^%secondsinhours%+3600)$
;insert text is just for testing so we can see we are where we belong at the end of
;each successive month of calculation
^!InsertText Seconds in Hour ^%basehour% ^$Calc(^%secondsinhours%+^%secondsindays%+^%secondsinmonths%+^%secondsinyears%+1167609600)$^P
;repeat until we hit current month (tested above)
^!Goto next_hour

:Loop_minutes_to_seconds
^!InsertText +++++++++++++++++++Full Minutes to Seconds Plus Seconds++++++++++++++++++++++++++^P
;calculate seconds in whole minutes today AND the REMAINING SECONDS TOO
^!Set %secondsinminutes%=^$Calc((^%minutes%*60)+^%seconds%)$
;insert text is just for testing so we can see we are where we belong at the end of
;each successive month of calculation
^!InsertText EPOCH TIME: ^$Calc(^%secondsinminutes%+^%secondsinhours%+^%secondsindays%+^%secondsinmonths%+^%secondsinyears%+1167609600)$^P
^!Goto end

Stripping an HTML File Before Uploading

March 10, 2007 on 3:07 am | In Special Clips - for someone | No Comments

Corl asked how to strip down an html file before uploading with notetab. His theory is that he doesn’t need comments on his remote copy and spaces and tabs and so forth for clear readability actually slow up/downloading and take unneccesary bandwidth. I suppose in a sense he’s right and so long as you keep your original copy … you can upload the stripped copy.

Here is a clip to do it:
;clip for Corl to strip down html files
;whacked at by don at htmlfixit dot com
;dated 03/09/2007
;copy online at:
;http://htmlfixit.com/blog/?p=355
;following line should remove all comments in html document
^!Replace "<!-- .* -->" >> "" ACIWRS
;should remove all returns
^!Replace "^P" >> "" ACIWS
;should remove all tabs
^!Replace "^T" >> "" ACIWS
;should remove all double spaces
^!Replace "\s+" >> " " ACIWRS
;should replace all > < with ><
^!Replace "> <" >> "><" ACIWS

Make Content Between Span Tag Lower Case

March 24, 2006 on 4:05 am | In Special Clips - for someone | No Comments

This clip will find span tags and turn the content inside of them to lower case. The clip does not impact the first character or that string however. This is in response to a post to the clip list on yahoogroups.

;*** Effort by Don Passenger
;*** don at htmlfixit dot com
;*** discuss things live in chat at http://htmlfixit.com
;*** donations welcome at http://htmlfixit.com
;this clip will make all content between span tags
;lowercase except that first character of string
;is not affected
;posted at http://htmlfixit.com/blog/?p=352

;go to start of document
^!Jump Doc_Start

;loop to check each tag to see if it is a meta
:Loop
;find next tag start
^!Find “<” TIS
;quit when no more tags
^!IfError Finish

^!ClearVariables
;### %TAG% will be empty if cursor is not inside a tag.
;determine if tag and get the name of the tag
;if not span cycle to next via NotTag subroutine
^!Set %TAG%=”^$GetHtmlTag(TRUE)$”
^!IfTrue ^$IsEmpty(^%TAG%)$ NotTag
^!Set %TAGNAME%=”^$GetHtmlTagName(“^%TAG%”;UPPERCASE)$”
^!If “SPAN” = “^%TAGNAME%” SPAN ELSE NotTag

:NotTag
^!Jump Select_End
^!Goto Loop

;if span tag, process text to lowercase
:Span
^!SetDebug On
^!Jump Select_End
;figure out where cursor is
^!Set %row%=”^$GetRow$”
^!Set %column%=”^$GetCol$”
:SpanEnd
;find end meta tag
^!Find “<” TIS
^!Set %TAG%=”^$GetHtmlTag(TRUE)$”
^!IfTrue ^$IsEmpty(^%TAG%)$ SpanEnd
^!Set %TAGNAME%=”^$GetHtmlTagName(“^%TAG%”;UPPERCASE)$”
^!If “/SPAN” <> “^%TAGNAME%” SpanEnd
;get in front of the tag
^!Jump Select_Start
;select between spans
^!SelectTo ^%row%:^$Calc(^%column%+1)$
^!Keyboard CTRL+L
^!Goto Loop

;line 54 including all blanks and comments

FileScrambleR

February 2, 2006 on 7:35 pm | In Administrative Clips, Notetab Clips | No Comments

Use NoteTabs internal ^!FileScramble feature to encode/decode files. Do 1 file, many files, or, an entire folder and its subfolders.

The Help file says;
The encryption algorithm is based on RC4 (“RC4″ is a trademark of RSA security corporation). You should not rely on this feature to protect very sensitive data.

I don’t know exactly what ‘very sensitive data’ is but, I would venture to say a very high percentage of us don’t have any on our computers. What most of us may have is more in the realm of ‘None Of Your Business’.

This Clip and the ^!FileScramble command should more than suffice for our majority.

INFO;
Start the Clip
Select Folder of choice
Select to show subfolders, or not, NO is default
Select to display files in the Wizard as selected, or not, NO is default
to do entire folder or folder\subfolders, select YES
Select whether to SCRAMBLER or UNSCRAMBLE
if you don’t choose clip restarts until cancelled
Accept, change, or delete the password entry. Be sure to record if changed.

FileScrambleR

Select between Markers, Add to ClipBook.

<>------------Marker------------<>
H="FileScrambleR"
;_ Modified-Updated~Created_20060202
;_ hrs ø hsavage·pobox·com_12:33:14p
^!Clearvariables
:START
^!SetListDelimiter |
^!Set %file_path%="^?{(T=D)CHOOSE FOLDER CONTAINING SUBJECT FILES=C:\}"; %sub%=^?{SHOW SUBFOLDERS==YES^=+|_NO^=^%empty%}; %sel%=^?{SHOW FILES AS SELECTED==YES^=_|_NO^=^%empty%}; %job%=^?{SCRAMBLE OR UNSCRAMBLE==SCRAMBLE|UNSCRAMBLE}; %key%="^?{INSERT ENCRYPTION KEY PASSWORD, < 256 characters=Enter_Key_Here}"
; - extensions to scramble
^!If '^%job%' = 'SCRAMBLE' NEXT ELSE SKIP_2
^!Set %hit%=*; %miss%=npw
^!Set %sort%=type
; - extension to unscramble
^!If '^%job%' = 'UNSCRAMBLE' NEXT ELSE SKIP_2
^!Set %hit%=npw; %miss%=*
^!Set %sort%=type
; - job not selected - restart
^!If '^%job%' = '' NEXT ELSE SKIP_2
^!Sound ^$GetAppPath$sounds\chataction.wav
^!Goto START
^!Set %next%=^$GetFileFirst("^%sub%^%file_path%";*.^%hit%;^%sort%)$
^!If '^%next%'='^%empty%' END
;
:COMPILE
^!IfSame "^$GetExt(^%next%)$" ".^%miss%" SKIP_1
^!Append %files%=^%next%|
^!Set %next%=^$GetFileNext$
^!If '^%next%' > '^%empty%' COMPILE
;
:DO_ARRAY
^!Set %files%=^$StrReplace("^%file_path%";"^%sel%";"^%files%";0;0)$
^!Set %files%=^$StrDeleteRight("^%files%";1)$
^!SetArray %files%=^?{(H=26;T=A)TEXT FILES TO LOAD!==^%files%}
;
^!Set %loop%=0; %count%=^%files0%
:LOOP
^!Inc %loop%
^!FileScramble "^%file_path%^%files^%loop%%" "" ^%key%
; - change ^!RecycleFile to ^!DeleteFile for non-recoverable deletion
^!RecycleFile "^%file_path%^%files^%loop%%"
^!If ^%loop% < ^%count% LOOP
<>------------Marker------------<>

Number of Valid Clip-lines=40

Set_View ini and disk BufferS

January 24, 2006 on 7:54 pm | In Notetab Clips, Special Clips - for someone, test clips | No Comments

Reposted 2/2/06
Here are revised, REVISED, clips, one to use NoteTabs users inifile feature to store tidbits of information, the other, to use disk files as a temporary storage medium.

For setting new buffers the clip uses the first word in the selection, if it is descriptive enough you can accept that name or type over with your own name choice.

Both approaches appear to work well, the disk file method doesn’t have the text selection size limitations of the ini file storage method.

Both approaches store a variable in memory at buffer creation. If you perform an action that wipes the variable, change or close the clipbook, close NoteTab, shut down the computer, you can regenerate the memory variable.

Go into the View_Set mode, select the buffers for which you want to regenerate memory variables, as you step thru each buffer view the variable is reset.

BOTH CLIPS ARE ON THIS PAGE.

<>····················<>
Set_View ini BufferS

Select between Markers, Add to ClipBook.

<>------------Marker------------<>
H="Set_View ini BufferS"
;_ Modified-Updated~Created_20060202
;_ hrs ø hsavage·pobox·com_11:05:59a
^!ClearVariables
^!Set %ww%=^$IsWordWrap$
^!SetScreenUpdate 0
^!SetIniFile ^$GetLibraryPath$Buffers
; - if no selection made, opens buffers.ini or exits
^!If ^$GetSelSize$ < 11 OPENFILE
; - seizes first word of selection as buffer name, can be typed over
^!Set %add%=^?{NAME BUFFER ADDITION=^$GetWord$}
^!Set %add%=^$StrReplace(" ";"_";^$StrTrim("^%add%")$;0;0)$
^!SaveValue ^$StrUpper("^%add%")$=^$GetSelection$
^!Select 0
; ·-·-·
; - switch comment from 'p_' line to set "permanent Variable"
^!Set %^$StrLower("^%add%")$%=^$GetValue("^%add%")$
;^!Set %p_^$StrLower("^%add%")$%=^$GetValue("^%add%")$
; ·-·-·
^!Goto REAL_END
; ·-·-·-·-·
:OPENFILE
^!IfFileExist ^$GetLibraryPath$Buffers.ini NEXT ELSE EXIT
^!Open ^$GetLibraryPath$Buffers.ini /j=1
^!SetWordWrap 0
; ·-·-·-·-·
:MAKE_LIST
; - loops thru and lists keys
^!Find ^[A-Z0-9_]+= RS
^!IfError SET_ARRAY
^!Set %extract%=^$StrReplace("=";"";"^$GetSelection$|";0;0)$
^!Append %list%=^%extract%
^!Goto MAKE_LIST
; ·-·-·-·-·
:SET_ARRAY
; - shows an array of key names
^!Set %list%=^$StrDeleteRight("^%list%";1)$
^!SetListDelimiter |
^!SetArray %list%=^?{(H=26;T=A)INI-BUFFER/S TO CHOOSE!==^%list%}; %bfr_action%=^?{VIEW BUFFERS, SET VARS -- DEL BUFFERS, CLEAR VARS==_VIEW_SET|DEL_CLEAR|VIEW_ONLY-ALL_BUFFERS}
; ·-·-·
:VIEW_ONLY-ALL_BUFFERS
; - to view buffer only, make no selection
^!If "^%list%" = "" EXIT ELSE ^!Close DISCARD
^!Set %loop%=0; %count%=^%list0%
; ·-·-·-·-·
:LOOP
^!Inc %loop%
^!Set %bfr_key%=^$GetValue("^%list^%loop%%")$
; ·-·-·
; - clears, resets chosen variable
^!ClearVariable %^$StrLower("^%list^%loop%%")$%
^!ClearVariable %p_^$StrLower("^%list^%loop%%")$%
; - switch comment from 'p_' line to set "permanent Variable"
^!Set %^$StrLower("^%list^%loop%%")$%=^%bfr_key%
;^!Set %p_^$StrLower("^%list^%loop%%")$%=^%bfr_key%
; ·-·-·
^!Goto ^%bfr_action%
; ·-·-·-·-·
:VIEW_SET
^!Info [L]TIDBIT·····^%list^%loop%%^%nl%^%nl%^%bfr_key%
^!Goto ANOTHER_LOOP?
; ·-·-·-·-·
:DEL_CLEAR
; - delete key, clear associated variable,
^!ClearValue ^%list^%loop%%
; ·-·-·
; - switch comment from 'p_' line to clear "permanent Variable"
^!ClearVariable ^%list^%loop%%
;^!ClearVariable %p_^%list^%loop%%%
; ·-·-·-·-·
:ANOTHER_LOOP?
^!If ^%loop% < ^%count% LOOP
; ·-·-·-·-·
:REAL_END
^!StatusClose
^!SetWordWrap ^%ww%
<>------------Marker------------<>

Number of Valid Clip-lines=76

<>··········Separator··········<>

Set_View Disk BufferS

Select between Markers, Add to ClipBook.

<>------------Marker------------<>
H="Set_View Disk BufferS"
;_ Modified-Updated~Created_20060202
;_ hrs ø hsavage·pobox·com_12:04:09a
; ·-·-·
; - Buffer names are restricted to characters
; - available for use in filenames
^!ClearVariables
^!SetScreenUpdate 0
^!Set %ww%=^$IsWordWrap$
; ·-·-·
^!Set %bfr_idx%="^$GetExpandedName(^##)$"
^!Set %bfr_dir%="^$GetDocumentPath$Buffers\"
; ·-·-·
; - adjustable, unless selection is => 11 characters
; - clip diverts to view/clear section
^!If ^$GetSelSize$ < 11 SET_ARRAY
; ·-·-·
^!IfFileExist "^%bfr_dir%nul" SKIP_1 ELSE NEXT
^!MkDir "^%bfr_dir%"
; ·-·-·-·-·
:MAKE_BFR
^!Set %bfr_name%=^?{ENTER MAKE_BUFFER NAME=^$GetWord$}
^!Set %bfr_name%=^$StrReplace(" ";"_";^$StrTrim("^%bfr_name%")$;0;0)$
^!SetCode %bfr_txt%=^$GetSelection$
^!TextToFile "^%bfr_dir%^$StrUpper(^%bfr_name%)$" ^%bfr_txt%
; ·-·-·
; - switch comment from 'p_' line to set "permanent Variable"
;^!Set %^$StrLower("^%bfr_name%")$%="^%bfr_txt%"
^!Set %p_^$StrLower("^%bfr_name%")$%="^%bfr_txt%"
; ·-·-·
^!Goto REAL_END
; ·-·-·-·-·
:SET_ARRAY
^!SetListDelimiter |
^!Set %files%=^$GetFiles("^%bfr_dir%";"*.*";NAME)$
^!If ^%files%=^%EMPTY% END
^!Set %files%=^$StrReplace("^%bfr_dir%";"^%empty%";"^%files%";0;0)$
^!SetArray %files%=^?{(H=26;T=A)BUFFER FILE TO CHOOSE!==^%files%}; %bfr_action%=^?{Open-Set vars, View-Set vars, DEL Files, Clear Vars==OPEN_SET|_VIEW_SET|DEL_CLEAR}
; ·-·-·
;_END_IF_NO_CHOICE
^!IfTrue ^$IsEmpty(^%files%)$ NEXT ELSE SKIP_3
^!StatusShow NO FILE SELECTED
^!Delay 25
; ·-·-·
^!Goto REAL_END
; ·-·-·
^!Set %loop%=0; %count%=^%files0%
; ·-·-·-·-·
:LOOP
^!Inc %loop%
^!Set %bfr_name%=^$GetFileName(^%files^%loop%%)$
^!SetCode %bfr_txt%=^$GetFileText("^%bfr_dir%^%bfr_name%")$
; ·-·-·
; - switch comment from 'p_' line to set "permanent Variable"
;^!SetCode %^$StrLower("^%bfr_name%")$=^%bfr_txt%
^!SetCode %p_^$StrLower("^%bfr_name%")$%=^%bfr_txt%
; ·-·-·
^!Goto ^%bfr_action%
; ·-·-·-·-·
:OPEN_SET
; - this will open the buffer file as an ordinary file
^!Open ^%bfr_dir%^%bfr_name%
; ·-·-·
^!Goto ANOTHER_LOOP?
; ·-·-·-·-·
:VIEW_SET
; - this will display in an ^!Info [L] box, can be selected and pasted
^!Info [L]TIDBIT·····^%bfr_name%^%nl%^%nl%^%bfr_txt%
; ·-·-·
^!Goto ANOTHER_LOOP?
; ·-·-·-·-·
:DEL_CLEAR
; - ^!RecycleFile or ^!DeleteFile, to recycle or, delete from disk
^!RecycleFile "^%bfr_dir%^%bfr_name%"
; ·-·-·
; - switch comment from 'p_' line to set "permanent Variable"
;^!ClearVariable %^$StrLower("^%bfr_name%")$%
^!ClearVariable %p_^$StrLower("^%bfr_name%")$%
; ·-·-·-·-·
:ANOTHER_LOOP?
^!If ^%loop% < ^%count% LOOP
; ·-·-·-·-·
:REAL_END
^!StatusClose
^!SetWordWrap ^%ww%
<>------------Marker------------<>

Number of Valid Clip-lines=85

Scramble_Multi Words

January 14, 2006 on 7:40 am | In General, Notetab Clips, Special Clips - for someone | No Comments

This clip, when run on normal text scrambles the characters in 4 letter words and above without altering the formatting of the text. It leaves the first and last characters of each word unchanged but scrambles the others.

I don’t know who’s responsible for the original algorithm but a writer, he thought it might make interesting reading, located an old clip named ‘JabberWords’ thru Google.

It would scramble most words but would leave some unscrambled, to be expected when randomizing any sequence. I modified the clip so it would not leave any unscrambled words of 4 characters or greater. Although, some 4 letter words are impossible to scramble in this manner.

Words such as seek, keep, been or look and others will not change.

This is the first paragraph, above, in scrambled form;

Tihs cilp, wehn run on nmraol txet sbraelcms the crhcartaes in 4 lteetr wdors and avboe wtuohit atrneilg the fiatorntmg of the txet. It lavees the frist and lsat caarchrets of ecah wrod ucanehgnd but slmrecabs the oherts.

Scramble_Multi Words

Cut and Paste what’s between the markers.


<>------------Marker------------<>
H="Scramble_Multi"
;_ Modified-Updated~Created_20060107
;_ hrs ø hsavage·pobox·com_11:09:29p
^!ClearVariables
; -place cursor in line where scrambling to start
^!Select LINE
^!Select 0
^!Set %rowCol%=^$GetRow$:^$GetCol$
^!Set %letters%=[a-zA-Z']
^!Set %letters4%=^%letters%^%letters%^%letters%^%letters%
^!SetScreenUpdate 0
;
:LOOP
^!Find "^%letters4%+" RS
^!IfError END_LOOP
;
:BASEDUP
^!Set %baseDup%=^$GetSelection$
^!Set %baseWord%=^$GetSelection$
^!Set %baseLen%=^$StrSize(^%baseWord%)$
; checks for 4 character words and handles accordingly.
^!If ^%baseLen% = 4 NEXT ELSE SCRAMBLE
^!If ^$StrCopy("^%baseWord%";2;1)$ <> ^$StrCopy("^%baseWord%";3;1)$ SCRAMBLE
;
:REWORD
; if scrambling is passed sets newWord = baseWord
^!Set %newWord%=^%baseWord%
^!Goto PASS
;
:SCRAMBLE
^!Set %firstChar%=^$StrIndex(^%baseWord%;1)$
^!Set %lastChar%=^$StrIndex(^%baseWord%;^%baseLen%)$
^!Set %newLen%=^$Calc(^%baseLen%-2)$
^!Set %baseWord%=^$StrCopy(^%baseWord%;2;^%newLen%)$
^!Set %randSort%=^%empty%
;
:BUILD_LOOP
^!if ^%baseWord%=^%empty% END_BUILD_LOOP
^!Set %randSort%=^%randSort%< ^$StrRandom(9;01)$>^$StrIndex(^%baseWord%;1)$^%nl%
^!Set %baseWord%=^$StrCopy(^%baseWord%;2;100)$
^!Goto BUILD_LOOP
;
:END_BUILD_LOOP
^!Set %sortedBlock%=^$StrSort(^%randSort%;0;1;0)$
^!Set %randWord%=^$StrStripHTML(^%sortedBlock%;0)$
^!Set %newWord%=^%firstChar%^$StrReplace(" ";^%empty%;^%randWord%;1;0)$^%lastChar%
;
; if newWord = baseWord, jumps
^!IfSame "^%newWord%" "^%baseDup%" BASEDUP
;
:PASS
^%newWord%
^!Jump SELECT_END
^!Goto LOOP
;
:END_LOOP
^!SetScreenUpdate 1
^!SetCursor ^%rowCol%
<>------------Marker------------<>

Number of Valid Clip-lines=58

ImageWrap

January 12, 2006 on 5:31 am | In Notetab Clips, Special Clips - for someone | No Comments

Select between the markers and paste into a new file named – ImageWrap.clb. Place in the Notetab Libraries folder

I’m having a problem getting this to display correctly to enable you to get a correct copy/paste.

If you copy/paste this library everything should be normal, except, double quotes. You will have to do a Search/Replace, search for – &quot; -, replace with the regular double quote character.


<>------------Marker------------<>
= V5 MultiLine NoSorting TabWidth=30

H="ReLoad Starting Files"
; in case you stop mid-clip and want to reload the
; files that were loaded when you started the clip.
^!OpenFavorites ImageWrap
^!DeleteFile ^$GetFavoritePath$ImageWrap.fvr

H=";Image_Wrap - IMPORTANT"
==========================================
Adapted, by many, from an original by Joe Barta jbarta@apk.net

http://junior.apk.net/~jbarta/image-wrap/

fortiter at gmail dot com
;_ Modified-Updated~Created_20060111
;_ hrs ø hsavage·pobox·com_06:50:10p
==========================================

"THIS LIBRARY 'AUTOMATICALLY SAVES AND CLOSES ALL OPEN FILES WHEN RUN'. WHEN IMAGEWRAP FINISHES FILES THAT WERE CLOSED, ARE RE-OPENED." You do not have to close files manually.

Convert a group of images into a suite of HTML pages linked from a single index page.

THE INDEX FILE MUST BE CREATED IN A DIRECTORY ABOVE - CLOSER TO THE ROOT FOLDER - (OR IN THE SAME DIRECTORY AS) THE IMAGES.

Click 'Begin New Pic_Index', make appropriate choices in dialogs and clips will build wrapper for the selected picture files.

When Selecting Pictures, Each Group In The Same Folder Must Be Selected As A Group, Re_Do The Image Loop To Select Pictures In Different Folders.

You Can Customize The Html Files By Digging Into The Clips "_Wrapper" And "_Index".

H="; ···················"

H="Build New Pic_Index"
^!ClearVariables
^!SetScreenUpdate 0
^!SaveFavorites ImageWrap
^!Close ALL,SAVE
;
^!Save As ^?[(T=S;F="All Files (*.*)|*.*")CHOOSE IMAGE FOLDER AND SAVE YOUR INDEX FILE=piclist.html]
;
^!Set %imagewrap_doc%=^$GetExpandedName(^##)$
^!Set %base_path%=^$GetPath(^$StrDeleteLeft("^%imagewrap_doc%";2)$)$
^!Set %base_path%=^$StrReplace("\";"/";"^%base_path%";0;0)$
^!Set %base_path%=file:///C|^%base_path%
;
^!Set %bgcolor%=^?[BACKGROUND COLOR (SELECT OR ENTER HEX CODE)=_FFFFFF (White)^=FFFFFF|000000 (Black)^=000000]
;
^!Set %txtcolor%=^?[TEXT COLOR (SELECT OR ENTER HEX CODE)=FFFFFF (White)^=FFFFFF|_000000 (Black)^=000000]
;
^!Set %doc_title%=^?[SET A TITLE FOR HTML FILES? (Leave Blank For None)=Image Collection]
;
^!Set %p_size%=^?[(H=9)Change DEFAULT to FRACTIONAL size, BETTER to VIEW.==100%^=1.0|90%^=.9|80%^=.8|70%^=.7|_60%^=.6|50%^=.5|40%^=.4|30%^=.3]
^!SetWordWrap 0
;
^!StatusShow Select Pictures In 1 Folder, Click Ok, Re_Do The Image Loop To Pick More Pictures.
^!Delay 40
^!StatusClose
;
:IMAGESELECT
^!Jump DOC_END
^?{(T=O;S=M;F="Image files (*.jpg;*.gif;*.png)|*.jpg;*.gif;*.png")CHOOSE IMAGE FILES, (Can repeat for files in different folders)}^%nl%
;
; Make item-per-line list removing semi-colons or quotes
^!Replace ";" >> "^P" TIWHSA
^!Replace """ >> "" TIWHSA
^!Skip IMAGE LIST COMPLETE, NO TO PICK MORE, YES/NO?
^!Goto IMAGESELECT
;
:PROCESS
; get the base path_1 of the file list
^!Set %base_path_1%=^$GetPath(^$GetDocName$)$
;
; get the name of file
^!Set %base_name_1%=^$GetFileName(^$GetDocName$)$
;
; get the total lines and initialize line count
^!Set %total_lines%=^$GetLineCount$
^!Set %current_line_number%=1
;
; Set up a pasteboard
^!ToolBar New Document
;
; go to loop
^!FarClip ImageWrap:OPERATE
;
; tidy up on return
; kill the pasteboard
^!Document LAST
^!DestroyDoc
;
; now we're at the file list
^!Select ALL
^!FarClip ImageWrap:Pic_Index
^!Close "^%imagewrap_doc%" SAVE
;
^!OpenFavorites ImageWrap
^!DeleteFile ^$GetFavoritePath$ImageWrap.fvr
^!Open ^%imagewrap_doc%
^!SetDocIndex ^$GetDocIndex("^%imagewrap_doc%")$
^!Prompt All done!

H="_Operate"
^!SetWordWrap 0
^!Document FIRST
^!SetCursor ^%current_line_number%:1
^!Select EOL
^!ToolBar Copy
;
; grab image particulars
^!Set %full_disk_path%=^$GetClipboard$
;
^!Set %img_width%="^$Calc(^$GetImgWidth(^$GetClipboard$)$*^%p_size%;0)$"
;
^!Set %img_height%="^$Calc(^$GetImgHeight(^$GetClipboard$)$*^%p_size%;0)$"
;
^!Set %image_name%=^$GetName(^$GetClipboard$)$
^!Set %image_ext%=^$GetExt(^$GetClipboard$)$
;
; get the relative disk & web path of the image to the file list
^!Document NEXT
^!ToolBar Clear All
^!InsertText ^%full_disk_path%
^!Replace "^%base_path_1%" >> "" TIWHSA
^!Replace "\" >> "/" TIWHSA
^!Select EOL
^!ToolBar Cut
^!Set %relative_web_path%=^$GetClipboard$
;
; build a save as filename out of the full_disk_path
^!ToolBar Clear All
^!InsertText ^%full_disk_path%
;
^!Replace ".gif" >> "_gif" TIWHSA
^!Replace ".jpg" >> "_jpg" TIWHSA
^!Replace ".png" >> "_png" TIWHSA
^!Select EOL
^!ToolBar Cut
^!Set %full_disk_html_path%=^$GetClipboard$.html
;
; build a href out of the relative web path
^!ToolBar Clear All
^!InsertText ^%relative_web_path%
;
^!Replace ".gif" >> "_gif" TIWHSA
^!Replace ".jpg" >> "_jpg" TIWHSA
^!Replace ".png" >> "_png" TIWHSA
^!Select EOL
^!ToolBar Cut
^!Set %href_html_path%=^$GetClipboard$.html
;
; make a nifty wrapper file
^!ToolBar New Document
;
^!FarClip ImageWrap:WRAPPER
^!Save As ^%full_disk_html_path%
^!ToolBar Close Document
;
^!Set %link%=<li><a href="^%href_html_path%">^%image_name%(^%image_ext%)</a></li>
;
; go to the list and insert the link in place of the existing line
^!Document FIRST
^!SetCursor ^%current_line_number%:1
^!Select EOL
^!ToolBar Cut
^!InsertText ^%link%
;
; Stop when line count gets to the end of the list
^!Set %current_line_number%=^$Calc(^%current_line_number%+1;0)$
^!IF ^%current_line_number% = ^%total_lines% EXIT
^!FarClip ImageWrap:OPERATE
;
:EXIT

H="_Wrapper"
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>^%doc_title%</title>
<!-- Created with ImageWrap

http://junior.apk.net/~jbarta/image-wrap/

modified by don from http://htmlfixit.com
fortiter at gmail dot com
Modified-Updated~Created_20060109
hrs ø hsavage·pobox·com_07:00:59p
-->
<style type="text/css">
<!--
body {background-color:#^%bgcolor%;}
h2, li, li a {color:#^%txtcolor%;}
-->
</style>
</head>

<body>

<p><a href="^%base_path%^%base_name_1%">Return to Image Menu</a></p>
<center>
<img src="^%image_name%^%image_ext%"
width="^%img_width%"
height="^%img_height%"
alt="^%image_name%"
border="0" />

</center>

</body>
</html>

H="_Pic_Index"
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>^%doc_title%</title>
<!-- Created with ImageWrap

http://junior.apk.net/~jbarta/image-wrap/

modified by don from http://htmlfixit.com
fortiter at gmail dot com
Modified-Updated~Created_20060109
hrs ø hsavage·pobox·com_07:00:59p
-->
<style type="text/css">
<!--
body {background-color:#^%bgcolor%;}
h2, li, li a {color:#^%txtcolor%;}
-->
</style>
</head>

<body>

<h2>^%doc_title%</h2>
<ul>
^&
</ul>
</body>
</html>

H="; ···················"
<>------------Marker------------<>

CliP_uuE_uuD

January 7, 2006 on 1:19 am | In Administrative Clips, Notetab Clips | No Comments

This clip is to UUencode/UUdecode clip for sending to our lists via email. Email, most times, wraps long lines and after copying and pasting from the email, makes restoring to a working clip very difficult at times.

UU, encoding and decoding encodes the text with a straight right margin which is narrower than the email default width, thus, no wrapped lines.

The clip is written so that it pastes a copy of itself after the encoded text. The user must copy the appropriate section of the email to a new file, at that time copy the encode/decode clip to a clipbook and then the user will be able to decode the encoded portion of the new ‘temporary’ file very easily.

After decoding, cut and paste the decoded clip into a clipbook and give it a whirl. It works flawlessly for me but some may run into trouble, if so, just respond to the clips list

CliP_uuE_uuD


<>------------Marker------------<>
H="_CliP_uuE_uuD"
;_ Modified-Updated~Created_20060111
;_ hrs ø hsavage·pobox·com_11:22:30p
^!Clearvariables
;
; - this line should be removed for others use
^!Set %c1%=^$DecToChar(94)$; %c2%=^$DecToChar(94)$^$DecToChar(164)$
;
; - determines whether file is encoded or not
; - if selection is greater than 'nn' characters clip assumes ENCODE
^!If ^$GetSelSize$ > 79 ENCODE ELSE DECODE
;
:ENCODE
; - to encode, run clip, select(mark) text, press Ctrl
^!SetHintInfo Select Text, CTRL To CONTINUE, SHIFT+CTRL To END!!
^!StatusShow Select Text, CTRL To CONTINUE, SHIFT+CTRL To END!!
; - loops while selecting text, press Ctrl to Continue
^!Delay 1
;
^!IfFalse ^$IsCtrlKeyDown$ SKIP_-1
^!IfTrue ^$Calc(^$IsShiftKeyDown$*^$IsCtrlKeyDown$)$ EXIT
^!IfTrue ^$IsCtrlKeyDown$ SKIP_-1
;
^!KeyBoard Ctrl+C
;
; - copies and encodes text to variable
; - lines kept short for email
^!SetCode %uu_E%="^$StrReplace("^%c1%";"^%c2%";"^$GetClipboard$";0;0)$"
^!SetCode %uu_E%=^$StrUUEncode("^%uu_E%")$
^!Delay 2
^!SetCode %trailer%=^%nl%^%nl%H="^$GetClipName$"^%nl%
^!SetCode %trailer%=^%trailer%^$GetClipText(^$GetClipName$)$
^!Delay 2
^!ActivateApp
^!Menu File/New
^!SetHintInfo Select Destination, PRESS SHIFT To Paste!!
^!StatusShow Select Destination, PRESS SHIFT To Paste!!
;
; - loops while selecting paste location,
; - press SHIFT to Continue
^!Delay 1
^!IfFalse ^$IsShiftKeyDown$ SKIP_-1
^!IfTrue ^$Calc(^$IsShiftKeyDown$*^$IsCtrlKeyDown$)$ EXIT
^!IfTrue ^$IsShiftKeyDown$ SKIP_-1
^!StatusClose
;
; - inserts header, encoded text - ^%uu_E% -and a copy of
; - the clip - ^%trailer% - that encodes/decodes it
^!Set %marker%=<>------------Marker------------<>^%nl%
;
^!IfFileExist "^$GetDocumentPath$uuencode.hdr" NEXT ELSE SKIP
^!InsertText ^$GetFileText(^$GetDocumentPath$uuencode.hdr)$
^!InsertCode ^%nl%^%nl%^%marker%^%uu_E%^%trailer%^%marker%
^!Save AS "^$GetSpecialPath(DeskTop)$uu_Encoded.en"
^!Goto END
;
:DECODE
; - to decode, place cursor anywhere within the
; - encoded text. don't select it
; - finds and selects upper and lower encoded text limits
^!Find "^begin 600" IWRS
^!IfError END
^!Set %begin%=^$GetRow$
^!Replace "^begin 600.*\n" >> "begin 600\s\n" RS
^!Find "^`\nend" IRS
^!IfError END
^!MoveCursor +1
^!SelectTo ^%begin%:1
; - copies encoding to clipboard and prepares re-inserts it
^!SetCode %uu_D%=^$StrUUDecode("^$GetSelection$")$
^!KeyBoard BACKSPACE
^!InsertSelect ^%uu_D%^%nl%^%nl%H=";···············"^%nl%
^!Replace "^%c2%" >> "^%c1%" TWHSA
^!Menu Modify/E-Mail/UnQuote Text
^!RenameDoc "uu_Decoded.de"
^!Save
;
:END
^!ClipBoardRestore
^!Jump 1
<>------------Marker------------<>

Number of Valid Clip-lines=80

NoteTab Googler

January 6, 2006 on 11:06 pm | In Notetab Clips, test clips | 1 Comment

Using NoteTab to Google was discussed on the Clips List. This is a modified version of Don’s clip. This uses a basic default choice but still allows user input in the second entry point in the same wizard.

The second clip contains many of the terms you might search for relating to NoteTab. Some multiple choices(entries) work together, some don’t. Not being familiar with Google I don’t know why some will, and some will not work.

Both clips are needed, the second constitutes the choice list utilized by the first clip and can be edited to suit.

NoteTab Googler


H="NoteTab Googler"
;_Modified-Updated~Created
;_20060105_11:14:07a_hsavage a-t pobox d-o-t com
;*** Search Google for Notetab Messages
;*** based on Utilities Library + RP Doolings Idea
;*** don a-t htmlfixit d-o-t com
;
^!ClearVariables
^!If ^$GetSelSize$ > 4 HaveSelection ELSE NoSelection
:HAVESELECTION
^!Set %SearchTerm%=^$GetSelection$
^!Goto TheSearch
:NOSELECTION
^!SetListDelimiter |
^!SetWizardTitle "Pick Search TermS"
^!SetWizardLabel "Search Terms, Primary, Secondary, Tertiary, etc."
;
^!Set %SearchTerm%=^$StrTrim("^$GetClipText(SearchTerms)$")$
^!Set %SearchTerm%=^$StrReplace("^p";"|";"^%SearchTerm%";0;0)$
^!Set %ExtraTerm%=^$SetDefaultValue(^%SearchTerm%;^%empty%)$
^!Set %SearchTerm%=^?{(H=17)"Choose One Here, Choose and Enter Others Below"==^%SearchTerm%}; %ExtraTerm%=^?{Choose One and/or Type Additional Terms Separated By Spaces=^%ExtraTerm%}
;
^!Set %SearchTerm%=^$StrTrim("^$StrReplace("; ";"";"^%SearchTerm% ^%ExtraTerm%";0;0)$")$
^!Set %SearchTerm%=^$StrReplace(" ";"+";"^$StrUpper("^%SearchTerm%")$";0;0)$
^!Goto TheSearch
:THESEARCH
; - replace all spaces in search term with +
^!URL http://www.google.com/search?q=site%3Ahttp%3A%2F%2Fgroups.yahoo.com+notetab+^%SearchTerm%

H="_SearchTerms"
_CLIPS
ACCESSIBILITY
ALBUM-EXPRESS
EZIMAGER
EZTHUMBS
HTML
MAILBAG
NEXTRELEASE
OFFTOPIC
OTL
OUTLINE
REGEX
SCRIPTS
SETDOCINDEX
STRRANDOM
TEMPLATE
THUMBNAILS
TPL
VARIABLES

FiXiT_UpLoadeR Prep

January 6, 2006 on 8:32 pm | In Administrative Clips, Notetab Clips | No Comments

This clip is made to convert clips for posting at fixit.com so they will display and users can easily download and not be required to make any changes to start using them.

I like this clip because it does the minimum number of changes to get a good display, also, it can be used to convert a single clip or a complete clipbook.

All conversion is done in set variables and a new blank file, the original remains unchanged.

FiXiT_4_CLIPS

<>------------Marker------------<>
H="FiXiT_4_CLIPS"
;_ Modified-Updated~Created_20060113
;_ hrs ø hsavage·pobox·com_01:50:13p
;
^!Clearvariables
^!SetWordWrap 0
^!Set %qu%=^$DecToChar(34)$
^!Set %and%=^$DecToChar(38)$
^!Set %marker%=<>------------Marker------------<>^%nl%
;
^!StatusShow Select Text Before Continuing, Read STATUS BAR For INFO!
^!SetHintInfo Press CTRL To CONTINUE, SHIFT+CTRL To END!!
; - loops while selecting text, press Ctrl to Continue
^!Delay 1
^!IfFalse ^$IsCtrlKeyDown$ SKIP_-1
^!IfTrue ^$Calc(^$IsShiftKeyDown$*^$IsCtrlKeyDown$)$ EXIT
^!IfTrue ^$IsCtrlKeyDown$ SKIP_-1
;
^!SetCode %fixit%=^$StrReplace("^%and%quot;";"|*and_quote*|";"^$GetSelection$";0;0)$
^!Menu File/New
^!SetCode %fixit%=^$StrReplace("|*and_quote*|";"^%and%amp;quot;";"^%fixit%";0;0)$
^!SetCode %fixit%=^$StrReplace("^%qu%";"^%and%quot;";"^%fixit%";0;0)$
;
^!InsertText Title if Needed^%nl%^%nl%^%nl%
^!Set %top%=^$GetRow$
^!InsertCode
^%nl%^%marker%
^!Set %top_row%=^$GetRow$
^!InsertCode ^%fixit%
^!Set %bottom_row%=^$GetRow$
^!InsertCode ^%marker%
^%nl%
^!InsertText Number of Valid Clip-lines=^$Calc(^%bottom_row%-^%top_row%)$
^!SelectTo ^%top%:1
^!Save AS "^$GetSpecialPath(DeskTop)$FiXiT_CLIPS.htmL"
^!Jump 1
<>————Marker————<>

Number of Valid Clip-lines=34

<>————Marker————<>

This clip is more for clips containing HTML code, other wise same as above.
FiXiT_4_HTML


<>------------Marker------------<>
H="FiXiT_4_HTML"
;_ Modified-Updated~Created_20060113
;_ hrs ø hsavage·pobox·com_01:58:10p
;
^!Clearvariables
^!SetWordWrap 0
^!Set %qu%=^$DecToChar(34)$
^!Set %and%=^$DecToChar(38)$
^!Set %md%=^$DecToChar(183)$
^!Set %marker%=<>------------Marker------------<>^%nl%
;
^!StatusShow Select Text Before Continuing, Read STATUS BAR For INFO!
^!SetHintInfo Press CTRL To CONTINUE, SHIFT+CTRL To END!!
; - loops while selecting text, press Ctrl to Continue
^!Delay 1
^!IfFalse ^$IsCtrlKeyDown$ SKIP_-1
^!IfTrue ^$Calc(^$IsShiftKeyDown$*^$IsCtrlKeyDown$)$ EXIT
^!IfTrue ^$IsCtrlKeyDown$ SKIP_-1
;
^!SetCode %fixit%=^$StrReplace("^%and%quot;";"|*and_quote*|";"^$GetSelection$";0;0)$
^!Menu File/New
^!InsertCode ^%fixit%
^!Menu Modify/Characters To HTML/ALL Special Characters
^!SetCode %fixit%=^$StrReplace("&quot;";"^%and%amp;quot;";"^$GetSelection$";0;0)$
^!SetCode %fixit%=^$StrReplace("|*and_quote*|";"^%and%amp;quot;";"^$GetSelection$";0;0)$
^!SetCode %fixit%=^$StrReplace("^%and%middot;";"^%md%";"^%fixit%";0;0)$
;
^!InsertText Title if Needed^%nl%^%nl%^%nl%
^!Set %top%=^$GetRow$
^!InsertCode <code>^%nl%^%marker%
^!Set %top_row%=^$GetRow$
^!InsertCode ^%fixit%
^!Set %bottom_row%=^$GetRow$
^!InsertCode ^%marker%</code>^%nl%
^!InsertText Number of Valid Clip-lines=^$Calc(^%bottom_row%-^%top_row%)$
^!SelectTo ^%top%:1
^!Save AS "^$GetSpecialPath(DeskTop)$FiXiT_HTML.htmL"
^!Jump 1
<>------------Marker------------<>

Number of Valid Clip-lines=38

Clip to Prepare Clips for Posting on this Site

January 6, 2006 on 5:12 am | In Administrative Clips, Notetab Clips | No Comments

When we prepare clips, we need to do a little work to get them ready. Quotes often turn into smart quotes. That appears to be an issue with our posting software. Sometimes it does and sometimes it doesn’t add smart quotes. It also chokes often because it mistakes the greater than and less than signs for example as html tags. Because of that we need to prepare a clip before posting it.

Here is a first try at a clip we can use to prepare a clip for posting:
;make sure we aren't wrapped
^!SetWordWrap Off
;fix problem caused if clip actually
;contains &quot; in it
^!Replace "&quot;" >> "|*and_quote*|" ACIWS
;convert quotes and other characters to html
^!Keyboard ALT+M &10 R &10 A
^!Replace """ >> "&quot;" ATIWS
;undo the original &quot; characters
^!Replace "|*and_quote*|" >> "&amp;quot;" ACIWS
;count lines and insert number of lines
^!Jump Doc_End
^!Keyboard ENTER
^!InsertText ;line number ^$GetLineCount$
^!ToolBar Copy All
;line number 16

Notetab Clip to Search Google For Term

January 3, 2006 on 8:39 am | In General, Generic Clips, Notetab Clips | No Comments

Okay, I often search Google to find Notetab’s great Yahoogroups messages. I find the search utility in YahooGroups to be fairly limiting. Tonight RP Dooling — the author – suggested that a clip might be in order … and that got me to thinking. Here is the first in what could easily be a series of clips to search.

This one will limit its search to Yahoogroups that contain the word notetab, either the term you have highlighted when you select the clip, or in the alternative, it will prompt you for a search term to add. It then fires up Google an it is off to the races.

So here it is …
;*** Effort by Don Passenger
;*** don a-t htmlfixit d-o-t com
;*** discuss things live in chat at http://htmlfixit.com
;*** donations welcome at http://htmlfixit.com
;*** Search Google for Notetab Messages
;*** based on Utilities Library + RP Doolings Idea

;START
; Clear variables
^!ClearVariables
^!If ^$GetSelSize$ > 0 HaveSelection ELSE NoSelection

:HaveSelection
^!Set %SearchTerm%=^$GetSelection$
^!Goto TheSearch

:NoSelection
^!Set %SearchTerm%=^?{Type in All Search Terms Separated by a Space}
^!Goto TheSearch

:TheSearch
;replace all spaces in search term with +
^!Set %SearchTerm%=^$StrReplace(" ";"+";"^%SearchTerm%";0;0)$
;replace all quotes in search term with %22
^!Set %SearchTerm%=^$StrReplace(""";"%22";"^%SearchTerm%";0;0)$
^!URL http://www.google.com/search?q=site%3Ahttp%3A%2F%2Fgroups.yahoo.com+notetab+^%SearchTerm%
;line 25 if no lines are wrapped

Smart Definition List Creation Clip

December 26, 2005 on 5:42 pm | In General, Generic Clips, Notetab Clips | No Comments

This clip will create a definition list in html coding.

Features:

  • it will create a blank list with specified number of dt and dd tags in ratio to each other
  • it will create a dl from a highlighted list using either every other, a set ratio or custom set determination of what is a dt and what is a dd
  • it will specify an id or class for the dl for those using css

;*** Effort by Don Passenger
;*** don a-t htmlfixit d-o-t com
;*** discuss things live in chat at http://htmlfixit.com
;*** donations welcome at http://htmlfixit.com
;*** Create a Definition List (DL) in HTML file v2.0
;*** based on the ordered/unordered clip shipped w/ Notetab
;*** posted here: http://htmlfixit.com/blog/index.php?p=331
;*** this version 2.0 involves some code improvements suggested
;*** or inspired by Bob McCallister fortiter at gmail dot com

;START
; Clear variables
^!ClearVariables
^!Set %listID%=^?{Give list an ID (or leave blank)=}; %listClass%=^?{Give list a Class (or leave blank)=}
^!If "^%listID%" = "" skip
^!Set %listID%=" id='^%listID%'"
^!If "^%listClass%" = "" skip
^!Set %listClass%=" class='^%listClass%'"
^!If ^$GetSelSize$ > 0 FormatSelection

;line 22
:CreateBlank
^!Set %CountDT%=^?{How many Definition Terms (DT):?=1|2|_3|4|5|6|7|8|9}
^!Set %CountDD%=^?{How many Definition Descriptions (DD) per (DT)?=_1|2|3|4|5|6|7|8|9}
^!InsertHtml <dl^%listID%^%listClass%>^P^$StrFill(  <dt></dt>^P^$StrFill(    <dd></dd>^P;^%CountDD%)$;^%CountDT%)$</dl>^P
^!Goto End

;line 29
:FormatSelection
;Divide selection at paragraph marks to make list
^!SetListDelimiter ^p
^!SetArray %delimited_data%=^$GetSelection$

;figure out if it is just every other one?
^!Set %pattern%="^$StrUpper("^?{Is There a Set Pattern?=_Every Other|Set Ratio|NO}")$"
;^!Set %pattern%=^$StrUpper("^?{Is There a Set Pattern?=_Every Other|Set Ratio|NO]")
^!If "^%pattern%" = "NO" BuildCustom
^!If "^%pattern%" = "SET RATIO" SetRatio
;set to one for every other
^!Set %dd%="1"
^!Goto BuildRatio

:SetRatio
^!Set %dd%=^?{How many (DD) Per (DT):?=1|_2|3|4|5|6|7|8|9}
^!Goto BuildRatio

;line 49
:BuildRatio
;should I test if the ratio works?
;maybe modulus on number if items

^!Set %Count%="1"
:CreateRatioDL
^!InsertHtml <dl^%listID%^%listClass%>^P
:CreateRatioDT
^!InsertHtml ^$StrFill(" ";2)$<dt>^%delimited_data^%Count%%</dt>^P
^!Inc %Count%
^!Set %CountDD%=^%dd%

:CreateRatioDD
^!InsertHtml ^$StrFill(" ";4)$<dd>^%delimited_data^%Count%%</dd>^P
^!Dec %CountDD%
^!Inc %Count%
^!If ^%CountDD% = 0 TestDT ELSE CreateRatioDD

:TestDT
^!If ^%Count% < ^%delimited_data0% CreateRatioDT

^!InsertHtml </dl>^P
;end of Build Ratio
^!Goto End

;line 77
:BuildCustom
^!Set %Count%="1"
:CreateCustomDL
^!InsertHtml <dl^%listID%^%listClass%>^P
:CreateCustomSwitch
^!Set %ThisItem%=^?{Is ^%delimited_data^%Count%% a(DT) or (DD):?=T|_D}
^!If "^%ThisItem%" = "D" CreateCustomDD ELSE CreateCustomDT

:CreateCustomDT
^!InsertHtml ^$StrFill(" ";2)$<dt>^%delimited_data^%Count%%</dt>^P
^!Goto TestCustomDT

:CreateCustomDD
^!InsertHtml ^$StrFill(" ";4)$<dd>^%delimited_data^%Count%%</dd>^P
^!Goto TestCustomDT

:TestCustomDT
^!Inc %Count%
^!If ^%Count% > ^%delimited_data0% CreateCustomDone
^!Goto CreateCustomSwitch

;line 101
:CreateCustomDone
^!InsertHtml </dl>^P
^!Goto Done

:Done
;if done say so
^!Info Done
;========= End =========
;line 111

Clip to Add class=”wrap” to last TD tag in each TR tag

December 24, 2005 on 8:13 pm | In Notetab Clips, Special Clips - for someone | No Comments

This is written in response to a request from Don Strack on the notetab clips list. His problem is that he wants to have a special class on the last TD tag in each set of TR tags in an existing page. He apparently adds new sets periodically, so he may already have some of them with a class attribute in them.

This clips has the following highlights:

  • it finds matching tr and /tr tag sets
  • it looks backwards through the tr tag to find the last td tag
  • it determines if there is already a class attribute in that td tag … and if yes, move on, if not, it adds it
  • then it steps to the next tr/tr tag set.

    ;*** Effort by Don Passenger
    ;*** don a-t htmlfixit d-o-t com
    ;*** discuss things live in chat at http://htmlfixit.com
    ;*** based on work by Larry and Jody and maybe Wayne
    ;*******************************************************
    ;*** will check for matching tr tags in a table
    ;*** then find the last td tag and if not yet
    ;*** set, add a class to the last td tag in each row

    ;### initialize everything
    ^!ClearVariables
    ^!Jump Doc_Start
    ; ———————————————-***
    ;line 14
    :FindTR
    ; find first tag
    ^!Find “<” TIS
    ;exit if find fails
    ^!IfError EXIT
    ;figure out where cursor is
    ^!Set %row%=”^$GetRow$”
    ^!Set %column%=”^$GetCol$”
    ; ———————————————-***
    ^!SET %START%=^%row%:^%column%
    ; ADDED THIS TO BE ABLE TO HAVE EVERYTHING
    ; SELECTED AT THE END OF THE CLIP
    ; ———————————————-***
    ^!SetScreenUpdate Off
    ^!SetWordWrap Off

    ;### %TAG% will be empty if cursor is not inside a tag.
    ^!Set %TAG%=”^$GetHtmlTag(TRUE)$”
    ^!IfTrue ^$IsEmpty(^%TAG%)$ NotTag

    ;### So we found a tag.  What tag is it?
    ^!Set %TAGNAME%=”^$GetHtmlTagName(“^%TAG%”;UPPERCASE)$”
    ^!Jump Select_End
    ;if this tag is not a TR, look for next tag
    ^!If “^%TAGNAME%” <> “TR” FindTR

    ;only get here if we are in a TR tag
    ^!Set %TAGCOUNT%=1

    ;line 46
    :FindNextTagForwards
    ^!Find “<” TIS
    ^!IfError UnMatched
    ^!Set %TAGTEMP%=”^$GetHtmlTag(TRUE)$”
    ^!IfTrue ^$IsEmpty(^%TAGTEMP%)$ NextTag
    ^!Set %TAGTEMPNAME%=”^$GetHtmlTagName(“^%TAGTEMP%”;UPPERCASE)$”
    ^!If “/” = “^$StrCopyLeft(“^%TAGTEMPNAME%”;1)$” EndTag ELSE BeginTag

    :EndTag
    ^!If “^$StrDeleteLeft(“^%TAGTEMPNAME%”;1)$” <> “^%TAGNAME%” Skip_2
    ^!Dec %TAGCOUNT%
    ^!If “^%TAGCOUNT%” = “0″ Match
    ^!Goto NextTag

    :BeginTag
    ^!If “^%TAGTEMPNAME%” <> “^%TAGNAME%” Skip_2
    ^!Inc %TAGCOUNT%
    ^!If “^%TAGCOUNT%” = “0″ Match
    ^!Goto NextTag

    :NextTag
    ^!Jump Select_End
    ^!Goto FindNextTagForwards

    ;line 71
    :Match
    ^!SetScreenUpdate On
    ^!Jump SELECT_END
    ; ———————————————-***
    ;^!SelectTo ^%row%:^%column%
    ^!SelectTo ^%START%
    ; ———————————————-***
    ;okay we have a complete TR to /TR Selected
    ;now look inside of it for last TD tag

    :FindTD
    ^!Find “<TD” TIBHS
    ^!Set %thisTD%=”^$GetHtmlTag(“Yes”)$”
    ^!Set %thisTDhasclass%=”^$StrCount(“class=”;”^%thisTD%”;No;No)$”
    ^!If ^%thisTDhasclass% > 0 FindTR
    ^!Replace “^$GetHtmlTagName(“^%thisTD%”)$” >> “^$GetHtmlTagName(“^%thisTD%”)$ class=”wrap”" CIHS
    ^!Goto findTR
    ^!Goto Finish

    ;line 91
    :UnMatched
    ^!SetCursor ^%row%:^%column%
    ^!Info [C]This appears to be an unmatched Tag.  We made it to the end of your document without finding a match.
    ^!Goto Finish

    ;### clean up and go home
    :Finish
    ^!SetScreenUpdate On
    ^!SetWordWrap On
    ^!ClearVariables
    ;line 102 if you have all lines unrapped (including blank lines)

Image Wrap Clip

December 17, 2005 on 2:18 pm | In General, Generic Clips, Notetab Clips | 1 Comment

This clip will wrap images into xhtml pages for viewing. It works like this:
1. all files must be closed before the clip is run
2. you will want to have your image in their own directory on the computer
3. you click on begin new index … it will ask if all files are closed … if yes, click continue
4. pick your directory using the little “…” button and give the “index” file a name
5. pick your images (you can use the control button to pick multiples
6. hang onto your hat and hold your breath because before you need to breath again you’ll have images each in their own html file with an index file

= V5 MultiLine NoSorting TabWidth=30

H=";ImageWrap - One Click"
==========================================
Adapted from an original by Joe Barta jbarta a-t apk d-o-t net

http://junior.apk.net/~jbarta/image-wrap/

==========================================

Convert a group of images into a suite of HTML pages linked from a
single index page. The index file Mmust be created in a directory
above (or in the same directory as) the images.

Close all NoteTab files before running this clip.

You can customise the HTML files by digging into the clips "_wrapper"
and "_index".

H="Begin new index"
^!Continue Are all files closed? If not - cancel and save, then restart.
^!Save As ^?[(T=S;F="All Files (*.*)|*.*")Name and path for index file=piclist.html]
^!Set %bgcolor%=^?[Background color (select or enter your own hex code)=_FFFFFF (White)^=FFFFFF|000000 (Black)^=000000]
^!Set %txtcolor%=^?[Text color (select or enter your own hex code)=FFFFFF (White)^=FFFFFF|_000000 (Black)^=000000]
^!Set %doc_title%=^?[Set a title for HTML files? (leave blank for none)=Image collection]
^!SetWordWrap Off

:ImageSelect
^!Jump TEXT_END
^?{(T=O;S=M;F="Image files (*.gif;*.jpg;*.png)|*.gif;*.jpg;*.png")Select files to be indexed:}

; Make item-per-line list removing semi-colons or quotes
^!SetCursor 1:1
^!Replace ; ^P ATIWS
^!SetCursor 1:1
^!Replace " ATIWS
^!Skip Image list complete?
^!Goto ImageSelect

^!SetScreenUpdate Off
;get the base path of the file list
^!Set %base_path%=^$GetPath(^$GetDocName$)$
;get the name of file
^!Set %base_name_1%=^$GetFileName(^$GetDocName$)$
;get the total lines and initialize line count
^!Set %total_lines%=^$GetLineCount$
^!Set %current_line_number%=1
;Set up a pasteboard
^!ToolBar New Document

; go to loop
^!Clip "operate"

; tidy up on return
;kill the pasteboard
^!Document LAST
^!DestroyDoc

;now we're at the file list
^!SetCursor 1:1
^!Select ALL
^!Clip "index"

^!ToolBar Save Document
^!Prompt All done!

H="_operate"
^!SetWordWrap Off
^!Document FIRST
^!SetCursor ^%current_line_number%:1
^!Select EOL
^!ToolBar Copy

; grab image particulars
^!Set %full_disk_path%=^$GetClipboard$
^!Set %img_width%=^$GetImgWidth(^$GetClipboard$)$
^!Set %img_height%=^$GetImgHeight(^$GetClipboard$)$
^!Set %image_name%=^$GetName(^$GetClipboard$)$
^!Set %image_ext%=^$GetExt(^$GetClipboard$)$

;get the relative disk & web path of the image to the file list
^!Document NEXT
^!ToolBar Clear All
^!InsertText ^%full_disk_path%
^!SetCursor 1:1
^!Replace ^%base_path% ATIWS
^!SetCursor 1:1
^!Replace / ATIWS
^!SetCursor 1:1
^!Select EOL
^!ToolBar Cut
^!Set %relative_web_path%=^$GetClipboard$

; build a save as filename out of the full_disk_path
^!ToolBar Clear All
^!SetCursor 1:1
^!InsertText ^%full_disk_path%
^!SetCursor 1:1
^!Replace .gif _gif ATIWS
^!SetCursor 1:1
^!Replace .jpg _jpg ATIWS
^!SetCursor 1:1
^!Replace .png _png ATIWS
^!SetCursor 1:1
^!Select EOL
^!ToolBar Cut
^!Set %full_disk_html_path%=^$GetClipboard$.html

; build a href out of the relative web path
^!ToolBar Clear All
^!SetCursor 1:1
^!InsertText ^%relative_web_path%
^!SetCursor 1:1
^!Replace .gif _gif ATIWS
^!SetCursor 1:1
^!Replace .jpg _jpg ATIWS
^!SetCursor 1:1
^!Replace .png _png ATIWS
^!SetCursor 1:1
^!Select EOL
^!ToolBar Cut
^!Set %href_html_path%=^$GetClipboard$.html

;make a nifty wrapper file
^!ToolBar New Document
^!Clip "wrapper"
^!Save As ^%full_disk_html_path%
^!ToolBar Close Document

^!Set %link%=<LI><A HREF="^%href_html_path%">^%image_name%
(^%image_ext%)</A></LI>
;go to the list and insert the link in place of the existing line
^!Document FIRST
^!SetCursor ^%current_line_number%:1
^!Select EOL
^!ToolBar Cut
^!InsertText ^%link%

; Stop when line count gets to the end of the list
^!Set %current_line_number%=^$Calc(^%current_line_number%+1;0)$
^!IF ^%current_line_number%=^%total_lines% EXIT

^!Clip "operate"

:EXIT

H="_wrapper"
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>^%doc_title%</title>
<!-- Created with ImageWrap
    http://junior.apk.net/~jbarta/image-wrap/
    as modified by don from http://htmlfixit.com
    and fortiter at gmail dot com
    -->
<style type="text/css">
<!--
body {background-color:#^%bgcolor%;}
h2, li, li a {color:#^%txtcolor%;}
-->
</style>
</head>

<body>

<center>
<img src="^%image_name%^%image_ext%"
    width="^%img_width%"
    height="^%img_height%"
    alt="^%image_name%"
    border="0" />

    <p><a href="^%base_name_1%">Return to Image Menu</a></p>
</center>

</body>
</html>

H="_index"
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>^%doc_title%</title>
<!-- Created with ImageWrap
    http://junior.apk.net/~jbarta/image-wrap/
    as modified by don from http://htmlfixit.com
    and fortiter at gmail dot com
    -->
<style type="text/css">
<!--
body {background-color:#^%bgcolor%;}
h2, li, li a {color:#^%txtcolor%;}
-->
</style>
</head>

<body>

<h2>^%doc_title%</h2>
<ul>
^&
</ul>
</body>
</html>

Hyperlink with Image

November 26, 2005 on 2:23 pm | In Generic Clips, Notetab Clips | 3 Comments

This is a clip that I wrote a while back, but enhanced as a result of this post to the ntp-clips list:

Hi all,

Was wondering if anyone knew of a clip which provided more options 
when inserting links into pages?

Specifically, I'm seeking a clip which gives me the option of 
inserting the following anchor info:

*  NAME
*  HREF
*  TARGET
*  IMG SRC
*  IMG HEIGHT   Ideally these two would be completed
*  IMG WIDTH   / for me, based on the IMG SRC.
*  IMG BORDER  
*  IMG ALT
*  IMG ALIGN

Is there such an HTML clip?

Many thanks!

Catherine

So here goes nothing, a clip to insert an image surrounded by a hyperlink that allows you to set the following attributes:

  1. target for the link
  2. name for the image (or did she mean for the hyperlink?)
  3. name for the link (see her comment below)
  4. image border
  5. image alignment

All of the other things she wanted are standard in the clips shipped with notetab.

So here is the clip …. note that there is one very long line in this clip that will break if you email it to someone.


; by: don at htmlfixit dot com
; creates a hyperlink from an image to a file
; fills in info about the image and prompts for
; target/name/alt/border/align attributes
; copy stored at: http://htmlfixit.com/blog/index.php?p=326

;I would like to get this running in one wizard
^!SetWizardLabel "Pick a File To Link To and Enter Value for Attributes"
; long line next (it needs to be unwrapped if you copy this)
^!InsertWizardHtml <A ^?[(T=T;F="Link Files|*.*htm*;*.php;*.pl;*.cgi")&Select the File to Link To] NAME="^?{Link &name=^&}" TARGET='^?[&Target (transitional)=blank^=_blank|parent^=_parent|self^=_self|top^=_top]'><IMG ^?{(T=T;F="Image Files|*.gif;*.png;*.jpg;*.jpeg")&browse to find image} NAME="^?{Image &name=^&}" BORDER="^?[(T=C)border level==_0|1|2|3|4|5|6]" ALIGN="^?[(T=C)align imgage==_left|right]" ALT="^?{Image text &description=^&}"></A>
; end of long line
; replace any double quotes with single
; better form to only use double when necessary
^!Replace " >> ' ATHS

:End

Delete All <a href> and <\a> Tags from a Document

June 14, 2005 on 10:22 pm | In General, Generic Clips | No Comments

This clip will remove all and tags from a document. This includes all links, including all mailto: links. The version as written asks if you want to remove each tag. After you are comfortable with the clip, there is a comment telling you to take out the skip if you don’t want confirmation.

;*** Effort by Don Passenger
;*** don a-t htmlfixit d-o-t com
;*** discuss things live in chat at http://htmlfixit.com
;*** based on work by Larry and Jody and maybe Wayne
;*******************************************************
;delete any a href tags

;start at top of document
^!Jump Doc_Start

;### initialize everything
;look forwards to find the starting < :Loop
^!Find "<" TIS
;exit if find fails
^!IfError Finish
^!SetScreenUpdate Off
^!ClearVariables

;### %TAG% will be empty if cursor is not inside a tag.
^!Set %TAG%="^$GetHtmlTag(TRUE)$"
^!IfTrue ^$IsEmpty(^%TAG%)$ NotTag

;### So we found a tag. What tag is it?
^!Set %TAGNAME%="^$GetHtmlTagName("^%TAG%";UPPERCASE)$"
;react if it is an A tag (opening or closing)
^!If "/A" = "^%TAGNAME%" HREF
^!If "A" = "^%TAGNAME%" HREF ELSE NotTag

:HREF
^!Select HTMLTAG
;delete following line if you want it to not ask before deleting
^!Skip Leave this tag in:^%nl%^$GetSelection$^%nl%^%nl%(Press Ctrl+Alt and click button to abort.)^%nl%
^!Keyboard DELETE
^!Goto Loop

:NotTag
^!Jump Select_End
^!Goto Loop

;### clean up and go home
:Finish
^!SetScreenUpdate On
^!ClearVariables
;line 46 if you have all lines unrapped (including blank lines)

Convert Bible Study Guide to HTML Format

June 9, 2005 on 4:11 pm | In Special Clips - for someone | 3 Comments

Alueet wrote:
> Would somebody like to help me, because I can’t make the clips.
> I’m making my own Daily devotion and I use Notetapro writing it and I
> take the text from the finnish Bible.
> Here is the original text and after that the result what I want the clip
> make.
>
> —————————-
> Fil 4:1-9
> (1) Rakkaat ja kaivatut veljeni, te minun iloni ja kunniaseppeleeni,
> pysykää siis horjumatta Herran yhteydessä, rakkaat ystävät!
> (2) Kehotan Euodiaa ja Syntykeä elämään sovussa Herraa palvellen.
> (3) Pyydän myös sinua, uskollinen työtoverini, auttamaan näitä naisia,
> jotka ovat minun kanssani taistelleet evankeliumin puolesta samoin kuin
> Clemens ja muutkin työtoverini, joiden kaikkien nimet ovat elämän kirjassa.
> (4) Iloitkaa aina Herrassa! Sanon vielä kerran: iloitkaa!
> (5) Tulkoon teidän lempeytenne kaikkien ihmisten tietoon. Herra on jo
> lähellä.
> (6) Älkää olko mistään huolissanne, vaan saattakaa aina se, mitä
> tarvitsette, rukoillen, anoen ja kiittäen Jumalan tietoon.
> (7) Silloin Jumalan rauha, joka ylittää kaiken ymmärryksen, varjelee
> teidän sydämenne ja ajatuksenne, niin että pysytte Kristuksessa
> Jeesuksessa.
> (8) Lopuksi, veljet, ajatelkaa kaikkea mikä on totta, mikä on
> kunnioitettavaa, mikä oikeaa, puhdasta, rakastettavaa ja kaunista, mikä
> vain on hyvää ja ansaitsee kiitoksen.
> (9) Tehkää sitä, mitä olette minulta oppineet ja vastaanottaneet, mitä
> olette minulta kuulleet ja minusta nähneet. Silloin rauhan Jumala on
> oleva teidän kanssanne.
> Saakoon ilo ja lempeys täyttää sydämemme. Muistakaamme, että Jumala on
> luvannut pitää meistä huolen. Jumalan rauha asukoon sydämissämme.
> Rakas Jeesus; opeta meitä ajattelemaan puhtaita asioita.
>
> —————————–
>
> Fil 4:1-9

> (1) Rakkaat ja kaivatut veljeni, te minun iloni ja kunniaseppeleeni,
> pysykää siis horjumatta Herran yhteydessä, rakkaat ystävät!
> (2) Kehotan Euodiaa ja Syntykeä elämään sovussa Herraa palvellen.
> (3) Pyydän myös sinua, uskollinen työtoverini, auttamaan näitä naisia,
> jotka ovat minun kanssani taistelleet evankeliumin puolesta samoin kuin
> Clemens ja muutkin työtoverini, joiden kaikkien nimet ovat elämän
> kirjassa.
> (4) Iloitkaa aina Herrassa! Sanon vielä kerran: iloitkaa!
> (5) Tulkoon teidän lempeytenne kaikkien ihmisten tietoon. Herra on jo
> lähellä.
> (6) Älkää olko mistään huolissanne, vaan saattakaa aina se, mitä
> tarvitsette, rukoillen, anoen ja kiittäen Jumalan tietoon.
> (7) Silloin Jumalan rauha, joka ylittää kaiken ymmärryksen, varjelee
> teidän sydämenne ja ajatuksenne, niin että pysytte Kristuksessa
> Jeesuksessa.
> (8) Lopuksi, veljet, ajatelkaa kaikkea mikä on totta, mikä on
> kunnioitettavaa, mikä oikeaa, puhdasta, rakastettavaa ja kaunista, mikä
> vain on hyvää ja ansaitsee kiitoksen.
> (9) Tehkää sitä, mitä olette minulta oppineet ja vastaanottaneet, mitä
> olette minulta kuulleet ja minusta nähneet. Silloin rauhan Jumala on
> oleva teidän kanssanne.

> Saakoon ilo ja lempeys täyttää sydämemme. Muistakaamme, että Jumala on
> luvannut pitää meistä huolen. Jumalan rauha asukoon sydämissämme.
>

> Rakas Jeesus; opeta meitä ajattelemaan puhtaita asioita.

This clip seems to fill the bill:

;*** Effort by Don Passenger
;*** don a-t htmlfixit d-o-t com
;*** discuss things live in chat at http://htmlfixit.com
;*******************************************************
; reformat bible verses

;start at the top (assuming whole file)
^!Jump Doc_Start
;set list delimiter to ( and get array elements
^!SetListDelimiter "("

;verify that there are no blank leading lines
:Check_Leading_Returns
^!Select Eol
;make sure it isn't empty item if it is END
^!If "^$GetSelection$" = "" Leading_Returns ELSE Format_Line_One
:Leading_Returns
^!Continue You have a blank line at the top of your document, can we delete it?
^!Keyboard DELETE

;Format First Line
:Format_Line_One
^!InsertHtml ^$GetSelection$

^!Jump +1

;Find end of (1)
^!Find "1)" TIS
^!IfError ABORT

;find next paragraph
:Process_Paragraph
^!Replace "^P(" >> "
^P(" TIS
^!IfError Process_Final_Paragraphs
^!Goto Process_Paragraph

^!SetDebug On
:Process_Final_Paragraphs
^!Replace ".^P" >> ".

^P" ATIS
^!Info [C]Successful Run, Congratulations
^!Goto End

:ABORT
^!Info [C]An Error Has Occurred -- Sorry

Remove Table Tags from XHTML or HTML Document

June 9, 2005 on 2:04 am | In Generic Clips | No Comments

This clip should remove all table, tr, and td tags from a document including end tags.

;*** Effort by Don Passenger
;*** don a-t htmlfixit d-o-t com
;*** discuss things live in chat at http://htmlfixit.com
;*******************************************************
;clip strips html table tags from entire document

;go to start of document
^!Jump Doc_Start

;loop to check each tag to see if it is a table tag
:Loop
;find next tag start
^!Find "< " TIS
;quit when no more tags
^!IfError Finish

^!ClearVariables
;### %TAG% will be empty if cursor is not inside a tag.
;determine if tag and get the name of the tag
;if not table tag cycle to next via NotTag subroutine
^!Set %TAG%="^$GetHtmlTag(TRUE)$"
^!IfTrue ^$IsEmpty(^%TAG%)$ NotTag
^!Set %TAGNAME%="^$GetHtmlTagName("^%TAG%";UPPERCASE)$"
;I think there are six tags in tables so
;these six options are tested and tag deleted if match
^!If "TABLE" = "^%TAGNAME%" Table
^!If "TD" = "^%TAGNAME%" Table
^!If "TR" = "^%TAGNAME%" Table
^!If "/TABLE" = "^%TAGNAME%" Table
^!If "/TD" = "^%TAGNAME%" Table
^!If "/TR" = "^%TAGNAME%" Table
^!Goto NotTag

:NotTag
^!Jump Select_End
^!Goto Loop

;if TABLE tag delete it
:Table
;delete the tag
;could just replace it with a
;or something like that if you wish
^!Keyboard DELETE

^!Goto NotTag

:Finish
^!Info [C]finished with this file
^!Goto End
;line 51 including all blanks and comments

Make Paragraphs with Links From Input

June 6, 2005 on 3:47 pm | In Special Clips - for someone | No Comments

Ok, take this:
U.S. Dive Travel
Offers packages to Bonaire’s Sand Dollar Condominium Resort.

http://www.usdivetravel[...]ONAIRE-Sand_Dollar.html

Sand Dollar Group
Offers project management and support for the development of web
sites, LAN and WAN design, data center relocations and custom
helpdesk integration.

http://www.sanddollargroup.com

Make it into this:


U.S. Dive Travel

Offers packages to Bonaire’s Sand Dollar Condominium Resort.

http://www.usdivetravel[...]ONAIRE-Sand_Dollar.html


Sand Dollar Group

Offers project management and support for the development of web
sites, LAN and WAN design, data center relocations and custom
helpdesk integration.

http://www.sanddollargroup.com

Obviously correcting it to xhtml formatting … cause I just cannot bring myself to use capital html tags any more.

;*** Effort by Don Passenger
;*** don a-t htmlfixit d-o-t com
;*** discuss things live in chat at http://htmlfixit.com
;*******************************************************
; Take paragraphs and make linked paragraphs
; assume double return between paragraphs

;start at the top (assuming whole file)
^!Jump Doc_Start
;set list delimiter to space and get array elements
^!SetListDelimiter "^P"

:paragraph
^!ClearVariables
;set cursor position
^!Set %row%="^$GetRow$"
^!Set %column%="^$GetCol$"

;find end of this "paragraph" of info
^!Find "^P^P" CIS
^!IfError END

^!Jump Select_End
;select the paragraph
^!SelectTo ^%row%:^%column%

;break the paragraph into an array
;element one is what will go into the
;link tag, "next-to-last" array element will be the
;link url itself and all "middle" elements
;will form the paragraph
;delimited array set by splitting line on returns
^!SetArray %delimited_data%=^$GetSelection$
;make sure it isn't empty item if it is END
^!If "^%delimited_data1%" = "" END

;delete selected paragraph now
^!Keyboard DELETE

;find the second from last element number
^!Set %link_element%=^$Calc(^%delimited_data0%-2)$
;the following could all be done
;on one long line ... or with short insertHTML's
;followed by jumps ... your choice
^!InsertHtml

^%delimited_data1%
^!Jump Select_End
^!InsertHtml

^P
^!Jump Select_End
;increment index for description
^!Set %indx%=2

:Loop_Description
;display each array element
^!InsertHtml ^%delimited_data^%indx%%
^P
^!If ^%indx% = ^$Calc(^%delimited_data0%-3)$ Next_Paragraph
^!Inc %indx%
^!Goto Loop_Description

:Next_Paragraph
^!InsertHtml

^P^P
^!Jump Select_End
^!Goto paragraph

Splitting a Line of Text on Spaces

June 3, 2005 on 5:53 pm | In Generic Clips, Notetab Clips | No Comments

You can create an array by dividing on a set character. In this example I split on spaces per the request of the writer.

;*** Effort by Don Passenger
;*** don a-t htmlfixit d-o-t com
;*** discuss things live in chat at http://htmlfixit.com
;*******************************************************
;I assume each line in the file is this 9 field data format:
;"title 1 some text title 2 other text 567034"

;start at the top (assuming whole file)
^!Jump Doc_Start

;set list delimiter to space and get array elements
^!SetListDelimiter " "

:Loop
;get the row we are in
^!Set %row%="^$GetRow$"
;select the current line where cursor resides
;this will select the entire line from prior
;line feed to this one
^!Select Paragraph
;delimited array set by splitting line on spaces
^!SetArray %delimited_data%=^$GetSelection$
^!Set %indx%=1
:Loop_Display
;display each array element
^!Info Row is: ^%row% ^PElement ^%indx% is ^%delimited_data^%indx%%
;check if we have used all elements in current row
;compare current index number to number of elements
;in the array using delimited_data0 - which stores
;the number of elements in an array
^!If ^%indx% = ^%delimited_data0% Next_Line

^!Inc %indx%
^!Goto Loop_Display
;move to next line and then continue
:Next_Line
;go to next line
^!Jump Select_End
;loop again if there are more rows
^!If ^%row% = ^$GetLinecount$ END ELSE Loop

Significant points in this clip:
1. use of the ^!SetArray command to divide on a preset delimiter (in this case a space)
2. use of the special 0 element in the array to determine how many elements are in the array
3. use of the line: “^!If ^%row% = ^$GetLinecount$ END ELSE Loop” to test if we are at the end of our file
testing if you are at the end of a file is a common necessity in notetab clips.

Find Values in Tags and Total Them

May 10, 2005 on 3:46 pm | In Special Clips - for someone | No Comments

This clip takes the following:
+ =
This person has values in tag sets named as above. I just read the first two values and then spit out the calculated value under the third tag. I don’t really error trap, other than to spit you out if these three tags don’t appear in succession.

;*** Effort by Don Passenger
;*** don a-t htmlfixit d-o-t com
;*** discuss things live in chat at http://htmlfixit.com
;*******************************************************
;*** will take this:
;-130.45
;-13.05
;xxxx
;and calculate the sum-net

; always start at the top of the document
^!Jump DOC_START

:LoopSum
;find the total-sum tag
;find next tag start
^!Find "< " TIS
;quit when no more tags
^!IfError Finish

^!ClearVariables
;%TAG% will be empty if cursor is not inside a tag.
;determine if tag and get the name of the tag
;if not "total-sum" cycle to next via NotTag subroutine
^!Set %TAG%="^$GetHtmlTag(TRUE)$"
^!IfTrue ^$IsEmpty(^%TAG%)$ NotTag
^!Set %TAGNAME%="^$GetHtmlTagName("^%TAG%";UPPERCASE)$"
^!If "TOTAL-SUM" = "^%TAGNAME%" TOTAL-SUM ELSE NotTag

:NotTag
^!Jump Select_End
^!Goto LoopSum

;if TOTAL-SUM tag, get the value
:TOTAL-SUM
;jump to the end of the TOTAL-SUM tag
^!Jump Select_End
;figure out where cursor is
^!Set %row%="^$GetRow$"
^!Set %column%="^$GetCol$"
;find the start of the /total-sum tag
;note I assume it is the next tag
;no error checking
^!Find "<" TIS
;select the number and then load it to a variable
^!SelectTo ^%row%:^%column%
^!Set %SUM%=^$GetSelection$

;NEXT GET THE SUM-VAT VALUE
;advance one line
^!Jump +1
;find the total-sum-vat tag
^!Find "<" TIS
;quit when no more tags
^!IfError Problem
^!Set %TAG2%="^$GetHtmlTag(TRUE)$"
^!IfTrue ^$IsEmpty(^%TAG2%)$ Problem
^!Set %TAGNAME2%="^$GetHtmlTagName("^%TAG2%";UPPERCASE)$"
^!If "TOTAL-SUM-VAT" = "^%TAGNAME2%" TOTAL-SUM-VAT ELSE Problem
;if TOTAL-SUM tag, get the value
:TOTAL-SUM-VAT
;jump to the end of the TOTAL-SUM-VAT tag
^!Jump Select_End
;figure out where cursor is
^!Set %row%="^$GetRow$"
^!Set %column%="^$GetCol$"
;find the start of the /total-sum-vat tag
;note I assume it is the next tag
;no error checking
^!Find "<" TIS
;select the number and then load it to a variable
^!SelectTo ^%row%:^%column%
^!Set %SUMVAT%=^$GetSelection$

;NEXT DO MATH AND REPLACE THE SUM-NET VALUE
;advance one line
^!Jump +1
;find the total-sum-vat tag
^!Find "<" TIS
;quit when no more tags
^!IfError Problem
^!Set %TAG3%="^$GetHtmlTag(TRUE)$"
^!IfTrue ^$IsEmpty(^%TAG3%)$ Problem
^!Set %TAGNAME3%="^$GetHtmlTagName("^%TAG3%";UPPERCASE)$"
^!If "TOTAL-SUM-NET" = "^%TAGNAME3%" TOTAL-SUM-NET ELSE Problem
;if TOTAL-NET tag, get the value
:TOTAL-SUM-NET
;jump to the end of the TOTAL-SUM-NET tag
^!Jump Select_End
;figure out where cursor is
^!Set %row%="^$GetRow$"
^!Set %column%="^$GetCol$"
;find the start of the /total-sum-net tag
;note I assume it is the next tag
;no error checking
^!Find "<" TIS
;select the number and then load it to a variable
^!SelectTo ^%row%:^%column%
;now do the math
^!SetClipboard ^$Calc(^%SUM%+^%SUMVAT%)$
^!Paste

;GET NEXT SET OF TAGS
;advance one line
^!Jump +1
^!Goto LoopSum

:Problem
^!Info [C]we have a tag mismatch -- something is wrong with formatting
^!Goto End

:Finish
^!SetScreenUpdate On
^!ClearVariables
;line 117 if you have all lines unrapped (including blank lines)

Clip for Editing Text: strikeout deletion / bold insertion

March 21, 2005 on 2:10 am | In Special Clips - for someone | No Comments

;whacked at by don at htmlfixit dot com
;from an example by hoylesp at acm dot org
;to edit stuff with three options (1a, 1b and 2)
;1.
;if highlighted text when start, then strike that
; and a.
; nothing if text box left empty
; or b.
; replace with bolded text from prompt box if entered
;2.
;if nothing selected insert added text
;see: http://htmlfixit.com/blog/index.php?p=317 for any updates

;figure out if anything is selected and jump to subroutine
^!If ^$GetCol$ = ^$GetColEnd$ insert ELSE selection_made

;we have a selection so strike it
:selection_made
^!InsertHTML ^&
;move after the selection
^!Jump Select_End

;insert the replace with text if any is given
:insert
^!Set %replacement%=^?{Replace with}
;if nothing entered in Replace jump to end
^!If ^$IsEmpty(^%replacement%)$ = 1 End
;insert in bold with spaces on each side
;if replacement text is given

Clip to Remove Set Number of Columns from Each Line in a File

February 9, 2005 on 10:55 pm | In Generic Clips | No Comments

;by don at htmlfixit dot com on 2/9/2005
^!Info This clip will x columns from all lines in a file
^!Set %remove%=^?{Enter Columns to Remove=_1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23}
^!Jump Doc_Start
^!SelectTo ^$GetLinecount$:^$Calc(^%remove%+1)$
^!Continue Is the last line selected to the proper column?
^!ToolBar Delete Block
^!Info [C]Done

I think this will work well. The select in Notetab is a little funky because it appears to highlight all, but then this Toolbar command only works on some columns, so to test if it got the right stuff, you need to carefully look at the last line. I added a continue there so you can stop it. The other two info’s are really surplus and can be discarded.

Clip to Strip Search Terms From Server Logs

February 4, 2005 on 10:50 pm | In General, Special Clips - for someone | 1 Comment

A list user had referrer logs on his server and wanted to strip the search terms from them. I wrote this:

;effort by don at htmlfixit.com
;02/04/05
; to take query terms from lines of stats
;one long example line
;http://www.google.com/search?hl=en&lr=&ie=UTF-8&oe=UTF-8&q="We are what we know"
;becomes
;"We are what we know"
;turn off wordwrap
^!SetWordWrap Off
;^!SetDebug On
;go to start of document
^!Jump Doc_Start
;loop for cleaning lines
:Loop
;highlight just this line
^!Select Eol
^!Find "?q=" TIHS
^!IfError TryAgain ELSE KillStart

:TryAgain
;sometimes it is &q=
^!Find "&q=" TIHS
^!IfError KillLine ELSE KillStart

:KillLine
;KillLine (not a search with a ?q=)
;delete highlighted line
^!DeleteLine
;repeat til done - if done go to done subroutine
^!If ^$GetRow$ = ^$GetLinecount$ DONE ELSE Next
; next line
^!Goto Loop

:KillStart
;KillStart (get rid of ?q= and everything before it)
;jump to select end
^!Jump Select_End
;select to line beginning
^!Select Bol
;delete highlighted piece
^!Keyboard DELETE

;now get rid of post search terms by finding &
;highlight just this line
^!Select Eol
^!Find "&" TIHS
^!IfError SKIP_3
;jump to select end
^!Jump Select_Start
^!Select Eol
;delete highlighted piece
^!Keyboard DELETE

;repeat til done - if done go to done subroutine
^!If ^$GetRow$ = ^$GetLinecount$ DONE ELSE Next

;advance to next line
^!Jump +1
;repeat
^!Goto Loop

:DONE
^!Info Done

On this test list:

http://cgi.resourceindex.com/detail/09039.html
http://www.google.com/search?q=”Invalid query: Column count doesn’t match value count at row”&sourceid=opera&num=0&ie=utf-8&oe=utf-8
http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=rgb color chooser
http://www.google.com.au/search?hl=en&ie=UTF-8&oe=UTF-8&q=regular expression remove path from file&btnG=Google Search&meta=cr=countryAU

http://www.cgi-resources.com/Programs_and_Scripts/Perl/Access_Counters/Combination/

http://www.google.ch/search?q=script download manager php&hl=de&lr=&ie=UTF-8&start=10&sa=N
http://www.google.se/search?hl=sv&ie=UTF-8&oe=UTF-8&q=html scripts +stats&meta=
http://www.google.ca/search?q=PHP string manipulation&ie=UTF-8&oe=UTF-8&hl=en&meta=
http://www.google.com/search?q=perl loops continue&ie=UTF-8&oe=UTF-8
http://www.google.com.hk/search?hl=zh-TW&ie=UTF-8&oe=UTF-8&q=HTML Fix the background&spell=1
http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=php splitting value by space
http://www.google.com/search?hl=en&lr=&ie=UTF-8&oe=UTF-8&q=”top == self” document.write javascript
http://www.google.com/search?sourceid=navclient&ie=UTF-8&oe=UTF-8&q=”file names” complete list fix
http://www.google.com/search?hl=en&lr=&ie=UTF-8&oe=UTF-8&q=”We are what we know”

http://www.dogpile.com/info.dogpl/search/web/can+a+virus+overtake+your+homepage%3F

http://www.google.com.au/search?hl=en&ie=UTF-8&oe=UTF-8&q=javascript validator &btnG=Google Search&meta=cr=countryAU

http://cgi.resourceindex.com/Programs_and_Scripts/Perl/Access_Counters/Combination/

http://www.google.com/search?q=PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN” allowed tags&hl=en&lr=&ie=UTF-8&oe=UTF-8&start=10&sa=N
http://www.google.ca/search?q=Regex links jpg&hl=en&lr=&ie=UTF-8&oe=UTF-8&start=10&sa=N

http://cgi.resourceindex.com/Programs_and_Scripts/Perl/File_Management/File_Downloading/

http://www.google.ca/search?q=Column count doesn’t match value count at row 1&ie=UTF-8&oe=UTF-8&hl=en&btnG=Google Search&meta=

http://cgi.resourceindex.com/Programs_and_Scripts/Perl/Access_Counters/Combination/

http://cgi.resourceindex.com/Programs_and_Scripts/Perl/Access_Counters/Combination/

http://www.google.com/search?sourceid=navclient&ie=UTF-8&oe=UTF-8&q=hello world perl
http://www.google.co.uk/search?q=HTML FIX IT.COM&ie=UTF-8&oe=UTF-8&hl=en&btnG=Google Search&meta=
http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=hello world perl script
http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=perl find number of items in hash&btnG=Google Search

http://cgidir.com/Scripts/Counters/

http://www.google.com/search?q=php string manipulation&sourceid=opera&num=0&ie=utf-8&oe=utf-8

http://htmlfixit.com/tutes/tute_menu.shtml

http://www.google.com/search?sourceid=mozclient&ie=utf-8&oe=utf-8&q=php string manipulation
http://www.google.com.au/search?hl=en&ie=UTF-8&oe=UTF-8&q=perl if elsif&meta=
http://www.gigablast.com/search?k3j=754263&s=70&q=cgi irc login
http://www.google.com.au/search?q=how to stop people from looking at your HTML source&hl=en&ie=UTF-8&oe=UTF-8

http://www.cgiresourceindex.com/Programs_and_Scripts/Perl/Access_Counters/Combination/

http://www.google.co.hu/search?q=list perl hash array example&btnG=Google keresés&hl=hu&ie=UTF-8&oe=UTF-8

http://www.cgi-resources.com/Programs_and_Scripts/Perl/Access_Counters/Combination/

http://www.google.com/search?q=fix html code&hl=iw&lr=&ie=UTF-8&inlang=iw&start=120&sa=N

http://www.cgi-resources.com/Programs_and_Scripts/Perl/Access_Counters/Combination/

http://htmlfixit.com/cgi-bin/yabb/YaBB.cgi?board=stats

http://www.google.com/search?hl=en&lr=&ie=UTF-8&oe=UTF-8&q=tutorials php string manipulation&btnG=Google Search
http://www.google.com.gr/search?hl=el&ie=UTF-8&oe=UTF-8&q=spliti functions tutorial&btnG=Αναζήτηση στο Google&meta=

http://www.freecgicode.com/cgi-bin/dir/search.cgi?query=counter

http://www.google.com.au/search?hl=en&ie=UTF-8&oe=UTF-8&q=mysql insert into matching columns&meta=

http://www.optima-system.com/pagespinner/spinnertalk/viewtopic.php?t=60

http://search.yahoo.com/search?p=examples of while loops in perl&ei=UTF-8&fr=fp-tab-web-t&n=20&fl=0&x=wrt
http://www.google.co.uk/search?hl=en&ie=UTF-8&oe=UTF-8&q=splitting strings in php&spell=1

http://www.optima-system.com/pagespinner/spinnertalk/viewtopic.php?t=60

http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=javascript counter free download&btnG=Google Search
http://www.google.co.uk/search?q=xhtml validation tools&ie=UTF-8&oe=UTF-8&hl=en&meta=

http://www.google.com/search?q=PageSpinner&hl=ja&lr=&ie=UTF-8&inlang=ja&start=40&sa=N

http://www.google.ro/search?q=download fix-it utilities 2004 free full&hl=ro&lr=&ie=UTF-8&oe=UTF-8&start=10&sa=N
http://www.google.com.au/search?q=fix mydoom.f&ie=UTF-8&oe=UTF-8&hl=en&meta=cr=countryAU

http://www.cgi-resources.com/Programs_and_Scripts/Perl/Access_Counters/Combination/

http://www.google.com/search?q=shtml vs html&hl=en&lr=&ie=UTF-8&start=10&sa=N
http://search.yahoo.com/search?p=free scripts download&ei=UTF-8&cop=mss&fr=fp-tab-web-t&b=21
http://www.google.co.uk/search?q=php security issues&hl=en&ie=UTF-8&oe=UTF-8
http://www.google.ca/search?q=xhtml validate&hl=en&lr=&ie=UTF-8&oe=UTF-8&start=10&sa=N

http://groups.yahoo.com/group/Anti-spam/message/2151

http://search.yahoo.com/search?p=xhtml vs. html&ei=UTF-8&fr=fp-tab-web-t&n=20&fl=0&x=wrt
http://www.google.co.in/search?q=payment gateway tutorial&hl=en&lr=&ie=UTF-8&oe=UTF-8&start=10&sa=N
http://www.google.com/search?q=Column count doesn’t match value count at row 1&sourceid=mozilla-search&start=0&start=0&ie=utf-8&oe=utf-8

http://www.hotscripts.com/Detailed/24085.html

That rendered the following:

“Invalid query: Column count doesn’t match value count at row”
rgb color chooser
regular expression remove path from file
script download manager php
html scripts +stats
PHP string manipulation
perl loops continue
HTML Fix the background
php splitting value by space
“top == self” document.write javascript
“file names” complete list fix
“We are what we know”
javascript validator
PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN” allowed tags
Regex links jpg
Column count doesn’t match value count at row 1
hello world perl
HTML FIX IT.COM
hello world perl script
perl find number of items in hash
php string manipulation
php string manipulation
perl if elsif
cgi irc login
how to stop people from looking at your HTML source
list perl hash array example
fix html code
tutorials php string manipulation
spliti functions tutorial
mysql insert into matching columns
splitting strings in php
javascript counter free download
xhtml validation tools
PageSpinner
download fix-it utilities 2004 free full
fix mydoom.f
shtml vs html
php security issues
xhtml validate
payment gateway tutorial
Column count doesn’t match value count at row 1

and I then used tools –> text statistics from the toolbar to get this information:

Word Frequency %

- 1 0.51
” 10 5.08
. 4 2.03
: 1 0.51
0 1 0.51
1 3 1.52
2004 1 0.51
allowed 1 0.51
are 1 0.51
array 1 0.51
at 4 2.03
background 1 0.51
by 1 0.51
cgi 1 0.51
chooser 1 0.51
code 1 0.51
color 1 0.51
Column 3 1.52
columns 1 0.51
COM 1 0.51
complete 1 0.51
continue 1 0.51
count 6 3.05
counter 1 0.51
document 1 0.51
doesn’t 3 1.52
download 3 1.52
DTD 1 0.51
elsif 1 0.51
EN 1 0.51
example 1 0.51
expression 1 0.51
f 1 0.51
file 2 1.02
find 1 0.51
fix 5 2.54
fix-it 1 0.51
free 2 1.02
from 2 1.02
full 1 0.51
functions 1 0.51
gateway 1 0.51
hash 2 1.02
hello 2 1.02
how 1 0.51
html 6 3.05
if 1 0.51
in 2 1.02
insert 1 0.51
into 1 0.51
Invalid 1 0.51
irc 1 0.51
issues 1 0.51
IT 1 0.51
items 1 0.51
javascript 3 1.52
jpg 1 0.51
know 1 0.51
links 1 0.51
list 2 1.02
login 1 0.51
looking 1 0.51
loops 1 0.51
manager 1 0.51
manipulation 4 2.03
match 3 1.52
matching 1 0.51
mydoom 1 0.51
mysql 1 0.51
names 1 0.51
number 1 0.51
of 1 0.51
PageSpinner 1 0.51
path 1 0.51
payment 1 0.51
people 1 0.51
perl 6 3.05
php 8 4.06
PUBLIC 1 0.51
query 1 0.51
Regex 1 0.51
regular 1 0.51
remove 1 0.51
rgb 1 0.51
row 3 1.52
script 2 1.02
scripts 1 0.51
security 1 0.51
self 1 0.51
shtml 1 0.51
source 1 0.51
space 1 0.51
spliti 1 0.51
splitting 2 1.02
stats 1 0.51
stop 1 0.51
Strict 1 0.51
string 4 2.03
strings 1 0.51
tags 1 0.51
the 1 0.51
to 1 0.51
tools 1 0.51
top 1 0.51
tutorial 2 1.02
tutorials 1 0.51
utilities 1 0.51
validate 1 0.51
validation 1 0.51
validator 1 0.51
value 4 2.03
vs 1 0.51
W3C 1 0.51
we 2 1.02
what 1 0.51
world 2 1.02
write 1 0.51
xhtml 3 1.52
your 1 0.51

Different words/items counted: 119
Total Words: 176
Total Punctuation: 5
Total Other Text: 6
Total Characters: 1086
Total Paragraphs: 41

I could do lots more with this, like sort on incidence, etc. This is just a start.

Strip HTML except Images and Links

January 14, 2005 on 10:38 pm | In Special Clips - for someone | No Comments

A reader asked if it is possible to strip all html except for image and link tags, and then reformat as a “clean” html page with links and images included in the finished product. I wrote this little script that does it as a notetab clip. It simply substitutes an unusual string for the < and > signs and then resubstitutes those later after removing the html tags. The removal tool is fooled into leaving these in because they are not html tags when they aren’t opened and closed with the <> signs.

;effort by don at htmlfixit.com
;1/13/05

;clip strips html except for image and a href
;tags, reformats to html using notetab
;and then restores fully the image and a href
;tags … note will not preserve tables etc.

;go to start of document
^!Jump Doc_Start
;turn off screen to hasten the job
^!SetScreenUpdate Off

;loop to check each tag to see if it is a meta
:Loop
;set counter to 0 — unless changes will not process
;this tag
^!Set %processtag%=”0″

;find next tag start
^!Find “< " TIS
;quit when no more tags
^!IfError Clean

^!ClearVariables
;### %TAG% will be empty if cursor is not inside a tag.
;determine if tag and get the name of the tag
;if not meta cycle to next via NotTag subroutine
^!Set %TAG%="^$GetHtmlTag(TRUE)$"
^!IfTrue ^$IsEmpty(^%TAG%)$ NotTag
^!Set %TAGNAME%="^$GetHtmlTagName("^%TAG%";UPPERCASE)$"
^!Set %TAG%="^$GetSelection$"

;if tag is A, /A or IMG (no matter on case)
;then go to DOTAG where we will process it
^!If "A" = "^%TAGNAME%" DOTAG
^!If "/A" = "^%TAGNAME%" DOTAG
^!If "IMG" = "^%TAGNAME%" DOTAG

;get here and go to next tag if not a
;special tag to preserve
:NotTag
^!Jump Select_End
^!Goto Loop

;process three special tags by putting
;unusual character sequence before and
;after and then it won't be removed
:DOTAG
^!Set %TAG%=^$StrDeleteLeft("^%TAG";1)$
^!Set %TAG%=^$StrDeleteRight("^%TAG";1)$
^!Set %TAG%=**|[|**^%TAG**|]|**
^!InsertText ^%TAG%
^!Goto NotTag

:Clean
;remove html (won't remove the replaced
;things as it doesn't think they are html
^!Keyboard SHIFT+CTRL+T
;convert document to html document
^!ToolBar Document to HTML
;reinstate the < and > so they
;magically become html tags again
;for the special three A, /A, IMG
^!Replace “**|[|**" >> "< " ATIWS
^!Replace "**|]|**” >> “>” ATIWS
;turn screen back on
^!SetScreenUpdate Off
;finish at the top
^!Jump Doc_Start
;tell em we are done
^!Info [C]finished with this file
;exit the clip
^!Goto EXIT
;line 77 including all blanks and comments

Strip Meta Keyword/Description Tags

January 13, 2005 on 9:15 pm | In Special Clips - for someone | No Comments

This clip will strip the meta tags but preserves the keywords and descriptions as html comments.

;effort by don at htmlfixit.com
;1/13/05

;clip strips html meta tags of type
;keywords and description from a document
;but leaves the keywords or description content
;in a comment with a preceeding comment saying
;what tag it came out of

;go to start of document
^!Jump Doc_Start

;loop to check each tag to see if it is a meta
:Loop
;set counter to 0 -- unless changes will not process
;this tag
^!Set %processmeta%="0"

;find next tag start
^!Find "< " TIS
;quit when no more tags
^!IfError Finish

^!ClearVariables
;### %TAG% will be empty if cursor is not inside a tag.
;determine if tag and get the name of the tag
;if not meta cycle to next via NotTag subroutine
^!Set %TAG%="^$GetHtmlTag(TRUE)$"
^!IfTrue ^$IsEmpty(^%TAG%)$ NotTag
^!Set %TAGNAME%="^$GetHtmlTagName("^%TAG%";UPPERCASE)$"
^!If "META" = "^%TAGNAME%" Meta ELSE NotTag

:NotTag
^!Jump Select_End
^!Goto Loop

;if meta tag, figure out if it is a description
;or a keyword metatag
:Meta
^!Set %METATAG%="^$GetSelection$"
;two long lines follow
^!Set %METAHTTP%="^$StrPos("HTTP-EQUIV=";"^$StrUpper("^%METATAG%")$";False)$"
^!Set %METADESCRIPTION%="^$StrPos("Description";"^$StrUpper("^%METATAG%")$";False)$"

;if description click the counter to one so we know what it is
^!If "^%METADESCRIPTION%" <> "0" next ELSE Skip_1
^!Set %NEEDPROCESSING%="1"

;if it is keyword click the counter to two so we know what it is
;long line follows
^!Set %METAKEYWORDS%="^$StrPos("Keywords";"^$StrUpper("^%METATAG%")$";False)$"
^!If "^%METAKEYWORDS%" <> "0" next ELSE Skip_1
^!Set %NEEDPROCESSING%="2"

^!If "^%NEEDPROCESSING%" = "0" Loop ELSE ProcessMeta

;we have either description or keywords meta
;so process it
:ProcessMeta
;trim out everything before and after content
;using left and right trims or copies
;long line follows
^!Set %METACONTENT%="^$StrPos("CONTENT=";"^$StrUpper("^%METATAG%")$";False)$"
^!Set %METACONTENT%=^$Calc(^%METACONTENT%+7)$
^!Set %METATAG%=^$StrDeleteLeft("^%METATAG";^%METACONTENT%)$
^!Set %QUOTE%="^$StrCopyLeft("^%METATAG";1)$"
^!Set %METATAG%=^$StrDeleteLeft("^%METATAG";1)$
^!Set %CLOSEQUOTE%="^$StrPos("^%QUOTE%";"^%METATAG%";False)$"
^!Set %METATAG%=^$StrCopyLeft("^%METATAG%";^$Calc(^%CLOSEQUOTE%-1)$)$

;insert proper comment for type of tag being cleaned
^!If "^%NEEDPROCESSING%" = "1" Next ELSE Skip_1
^!InsertHtml 
^!If "^%NEEDPROCESSING%" = "2" Next ELSE Skip_1
^!InsertHtml 

;replace the existing tag with the words in a comment tag
^!InsertHtml 

^!Goto NotTag


:Finish
^!Info [C]finished with this file
^!Goto EXIT
;line 86 including all blanks and comments

List all capitalized words in a file

December 4, 2004 on 10:12 pm | In Special Clips - for someone | No Comments

A reader on the notetab list asked for a clip to generate a list of words with a first letter capitalized (the rest of the word can be upper or lower cased so long as the first letter is capitalized). I tried a couple of versions that worked pretty well on my test files. Because the sort function puts umlauted characters at the bottom of the alphabet in a sort and the reader wanted to preserve umlauted characters, I decided that this method was better. This clip ran 8 minutes for the reader on a 500K file. I didn’t disable screen update so you can see the progress, but that also slows the machine.

Here is the clip:

; by don at htmlfixit.com
; using a bunch of Hugo's ideas
; runs a text file and makes
; a list of all words that start
; with a capital letter
^!Menu Edit/Copy All
^!Toolbar Paste New
^!Replace "^P" >> " " ATIWS
^!Replace ")" >> " " ATIWS
^!Replace "(" >> " " ATIWS
^!Replace """ >> " " ATIWS
^!Replace "^T" >> " " ATIWS
^!Replace "," >> " " ATIWS
^!Replace "[" >> " " ATIWS
^!Replace "]" >> " " ATIWS
^!Replace "< " >> " " ATIWS
^!Replace ">" >> " " ATIWS
^!Replace "~" >> " " ATIWS
^!Replace "!" >> " " ATIWS
^!Replace "@" >> " " ATIWS
^!Replace "#" >> " " ATIWS
^!Replace "$" >> " " ATIWS
^!Replace "%" >> " " ATIWS
^!Replace "^" >> " " ATIWS
^!Replace "&" >> " " ATIWS
^!Replace "*" >> " " ATIWS
^!Replace "_" >> " " ATIWS
^!Replace "+" >> " " ATIWS
^!Replace "=" >> " " ATIWS
^!Replace "|" >> " " ATIWS
^!Replace "{" >> " " ATIWS
^!Replace "}" >> " " ATIWS
^!Replace "" >> " " ATIWS
^!Replace "/" >> " " ATIWS
^!Replace "?" >> " " ATIWS
^!Replace "." >> " " ATIWS
^!Replace ";" >> " " ATIWS
^!Replace ":" >> " " ATIWS
^!Replace "" >> " " ATIWS
^!Replace "•" >> " " ATIWS
^!Replace "– " >> " " ATIWS
^!Replace "´" >> " " ATIWS
^!Replace "’" >> " " ATIWS
^!Replace "“" >> " " ATIWS
^!Replace "‘" >> " " ATIWS
^!Replace "`" >> " " ATIWS
^!Replace "¡" >> " " ATIWS
^!Replace "¢" >> " " ATIWS
^!Replace "£" >> " " ATIWS
^!Replace "¤" >> " " ATIWS
^!Replace "¥" >> " " ATIWS
^!Replace "§" >> " " ATIWS
^!Replace "©" >> " " ATIWS
^!Replace "«" >> " " ATIWS

^!Menu Modify/Spaces/Single Space
^!Replace " " >> "^P" ATIWS
^!Replace "^P´" >> "^P" ATIWS
^!Replace "^P-" >> "^P" ATIWS
^!Replace "^P " >> "^P" ATIWS
^!Menu Edit/Copy All
^!SetClipboard ^$StrSort("^$GetClipboard$";1;1;1)$
^!Select All
^!Toolbar Paste
^!Jump 1

; following is to dump all numer or lower cased
; first character lines
:DumpBad
^!If ^$GetRow$ = ^$GetLinecount$ Sort2
^!Select +1
^!IfTrue ^$IsEmpty("^$GetLine$")$ NEXT ELSE SKIP_2
^!Keyboard DELETE
^!GoTo DumpBad

^!If "^$IsNumber("^$GetSelection$")$" = "1" SKIP
^!If "^$IsUppercase("^$GetSelection$")$" = "1" SKIP_4
^!Select Eol
^!Keyboard DELETE
^!Keyboard DELETE
^!GoTo DumpBad

:GoNext
^!Jump +1
^!GoTo DumpBad

; following is to eliminate single characters on one line
:Sort2
^!Jump 1

:Sort2a
^!Select Eol
^!IfError END
^!If ^$StrSize("^$GetSelection$")$ > 1 SKIP_2
^!Keyboard DELETE
^!Keyboard DELETE
^!Jump +1
^!GoTo Sort2a

This also removes any single character lines (under the theory those aren’t words).

Significant things done in this clip:
generating a list of words by replacing most non-alphanumeric with a space
replacing all double spaces with a single space and a return
sorting of the words that are now on single lines using the function in notetab
elimate all lines that don’t have an uppercase letter as the first character (note that we needed to use the test clip info to be sure that ^!IsUppercase was alphabetic before testing if it was upper case)
remove lines with only one character on them

^$IsUppercase really means NotLowercase

December 4, 2004 on 10:02 pm | In test clips | No Comments

I found something interesting the other day … non-uppercase characters were testing positive for ^$IsUppercase. While you might presume only an uppercase character/string would test positive for this, it is actually testing to be sure there are no lower-case alphabetic characters. The opposite is also true with ^$IsLowercase testing for Not Uppercase. So you first need to be sure you don’t have either a number or a non-alphabetic character if that is important before using either ^$IsUppercase or ^$IsLowercase

Testing the ^$IsUppercase function:

; by don at htmlfixit.com
; any-non lowercase non-alphabetic
; character tests positive as Uppercase
^!SetArray %Original%="0";"1";"|";"?";"a";"@";"1";"+";"=";"F";"`";"~";"-";"q";"L";"[";"}";" ";"x"
^!Set %count%=0
:Loop
^!Inc %count%
^!If "^%count%" > "^%Original0%" End

^!If "^$IsUppercase("^%Original^%count%%")$" = "1" UPPER ELSE NOTUPPER

:UPPER
^!Info "^%Original^%count%%" is POSITIVE when tested as upper case -- even if it isn't a letter
^!GoTo Loop

:NOTUPPER
^!Info "^%Original^%count%%" is negative when tested as upper case
^!GoTo Loop

Testing the ^$IsLowercase function:

; by don at htmlfixit.com
; any-non lowercase non-alphabetic
; character tests positive as Uppercase
^!SetArray %Original%="0";"1";"|";"?";"a";"@";"1";"+";"=";"F";"`";"~";"-";"q";"L";"[";"}";" ";"x"
^!Set %count%=0
:Loop
^!Inc %count%
^!If "^%count%" > "^%Original0%" End

^!If "^$IsLowercase("^%Original^%count%%")$" = "1" UPPER ELSE NOTUPPER

:UPPER
^!Info "^%Original^%count%%" is POSITIVE when tested as lower case -- even if it isn't a letter
^!GoTo Loop

:NOTUPPER
^!Info "^%Original^%count%%" is negative when tested as lower case
^!GoTo Loop

^$GetLinecount$ updates as lines are deleted

December 4, 2004 on 9:57 pm | In test clips | No Comments

I wanted to see if ^$GetLinecount$ updates on the fly every time a line is deleted. It does as shown by the following clip:

; by don at htmlfixit.com
; this clip is to show that
; if you delete lines the
; variable ^$GetLinecount$ updates
; itself on the fly

;create file
^!Menu File/New
;put 10 lines in the file
^!InsertText 1^P2^P3^P4^P5^P6^P7^P8^P9^P10
;display linecount, should be 10
^!Info Line Count: ^$GetLinecount$
;put cursor at bottom
^!Jump Doc_End
;select to line 6
^!SelectTo 6:1
;delete last 5 lines
^!Keyboard DELETE
^!Keyboard BACKSPACE
;display linecount, should be 5
^!Info Line Count: ^$GetLinecount$
; it works! ^$GetLinecount$ updates

Open Files in Irfanview

December 1, 2004 on 5:15 pm | In General, Generic Clips | No Comments

A reader on the YahooGroups Clips List was wondering how to open files in Irfanview via a NoteTab Clip. I proposed the following two solutions:
Continue reading Open Files in Irfanview…

Generate Random List of CSV Field Data

November 29, 2004 on 4:16 am | In Special Clips - for someone | No Comments

This clip will take a selection of data contained in a comma separated file (without quotes) and reorder those fields in a random fashion.

Continue reading Generate Random List of CSV Field Data…

HTML: Remove & and replace with &amp

November 29, 2004 on 4:06 am | In Generic Clips | No Comments

It is often necessary to replace the & character with the entity &amp; to get validated (x)html. This clip will replace all appropriate ampersands excluding those that are part of defined character entities.
Continue reading HTML: Remove & and replace with &amp…

Remove Lines with Numbers

November 29, 2004 on 4:02 am | In Generic Clips | No Comments

This regex loop will remove all lines that contain only numbers on them. There is a quirk so that it won’t work correctly on one pass, so I loop it to get it to work correctly.

; by don at htmlfixit.com
; removes all numbers on a line
; for some reason the regex doesn't
; work right, so I repeat to
; get all instances -- odd but
; sometimes it goes that way
:Loop
^!Replace "^\d+\n" >> "" ATIWRS
^!IfError END
^!Jump 1
^!GoTo Loop

Sample input:

this
that
12
567
a324
-you
15
x374

Sample output:

this
that
a324
-you
x374

Keywords: regex, regular expression, remove, numbers, line, loop, repeat

Calculate Splits for a 5 Kilometer Race

November 29, 2004 on 3:55 am | In General, Special Clips - for someone | No Comments

I regularly have to create target splits for a five kilometer (5K or 5,000 Meter) race. This clip creates even mile splits based upon a target finish time. Continue reading Calculate Splits for a 5 Kilometer Race…

Find Sub-string in Longer String

November 29, 2004 on 3:45 am | In General, Generic Clips | No Comments

These may display very funny for some people because of the use of the pre html tag. Continue reading Find Sub-string in Longer String…

Notetab Clips

November 29, 2004 on 3:37 am | In General, Notetab Clips | No Comments

I am a big fan of NoteTab, a text editor on steroids. I use the pro version of this software, but there is also a free, no nags or advertisements, light version available. One of my favorite features of Notetab is the clips (and I will save a bunch I wrote/write here) Continue reading Notetab Clips…

Powered by WordPress with Pool theme design by Borja Fernandez.
Entries and comments feeds. Valid XHTML and CSS. ^Top^

Bad Behavior has blocked 372 access attempts in the last 7 days.