ImageWrap

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 – " -, 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------------<>

Leave a Reply

Recent Posts

Archives

Topics