CliP_uuE_uuD
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