showing photos in TSE

4 views
Skip to first unread message

Larry

unread,
Dec 12, 2009, 9:37:58 AM12/12/09
to GoogleSemWare TSE, TsePro

It was truly marvelous for Carlo to show some "magical dll" that allowed TSE
to play a .wav file using a TSE macro! Wasn't it?

Well, is there such "magic" that would allow a photo to be displayed using a
TSE macro?

It can be done using iexplore.exe, but every instance of executing iexplore
from a dos commandline opens a new internet explorer window as a separate
instance. In addition, you leave TSE and go to internet explorer to see the
photo, then close ie before going back to TSE.

There are many programs available to show photos, but with every one of
them, something is missing...control. With programs other than TSE, you have
to do it "their" way, and there is no-chance that you can get in touch with
them to get them to change things to "your" way.

Other programs can have a macro language (usually not), but you have to
learn the language first, and chances are that you will not be able to do
what you want in the end.

TSE's macro language permits almost anything that can be done to text over a
large number of files.

It would simply be GREAT if one could display a photo with a macro, like
playing a .wav file with a macro.

As I envision it, a macro would offer some form of selection, and then the
macro would display the image like a popup on the TSE screen, with other
controls that could go to the Next photo, Prev photo, and so on. The idea is
to create description data for photos, divide it into sets, and be able to
choose sets to display.

This can be done (and I have done it) with html, but html is a passive (no
variables) language that cannot make decisions the way a TSE macro can.

Forlorn hope... is there a "magical dll" tool that will permit the display
of a photo on the TSe screen?


knud van eeden

unread,
Dec 12, 2009, 10:59:02 AM12/12/09
to sem...@googlegroups.com, TsePro
-Embedding the picture in the TSE window itself? At this moment I think that that will be possible is unlikely (by design of the used Microsoft Windows APIs and implementation (console API versus GUI API)).

===

-The only graphics in combination with TSE I have seen was a New Year greeting macro from Carlo. I have not looked in the details. But it looked really nice and was a big surprise that was possible. So you never know ;-)

===

-So probably one has to stick to using workarounds:

===

PROC Main()
StartPgm( "yourExternalPictureViewer.exe", "yourPictureFilename.jpg" )
END

===

or similar

PROC Main()
Dos( "yourExternalPictureViewer.exe yourPictureFilename.jpg" )
END

===

If wanting to combine TSE with passive HTML (browser), one can get much more control by embedding ('active') JavaScript in HTML.

That should maybe not be so difficult, but indeed one has to look a bit more at that program language, which might be a barrier.

To start with write the following in TSE

PROC Main()
EditFile( "c:\foo.htm" )
AddLine( "<SCRIPT>" )
AddLine( 'alert( "Hello world" );' )
AddLine( "</SCRIPT>" )
SaveFile()
StartPgm( "c:\foo.htm" )
END

save it as "c:\bar.s",
compile it,
and there you are controlling your browser already a bit more.

Similar you could create almost any program (be it HTML, JavaScript, Perl, Python, Ruby, Java, C++, Total Commander, other text editors (Emacs, ...), even TSE itself (use e.g. sc32.exe to compile that text, that will on th fly create a new macro), ...) by printing (e.g. to file) (using e.g. AddLine()) the source code.

This method is a special case of the 'automatic program generation technique' (that is just 'print your source code to file' using some tool). And I use that method a lot to use TSE to control other programs.

Any program that has a text language (e.g. script language do by design) and allows to be started from the outside world (e.g. the command line) can be controlled like that from TSE.

You could thus similarly even print from TSE your own picture viewer program in e.g. JavaScript and e.g. HTML that way, and control it (a bit more).

So combining the best of both or all worlds.

with friendly greetings,
Knud van Eeden



Why Tea

unread,
Dec 12, 2009, 7:09:01 PM12/12/09
to SemWare

> This can be done (and I have done it) with html, but html is a passive (no
> variables) language that cannot make decisions the way a TSE macro can.

Not quite true as you can embed Javascript, VBScript, etc. in HTML
which are executed on the client side (i.e. the browser).

wbport

unread,
Feb 2, 2010, 4:30:57 PM2/2/10
to SemWare
Assuming you have a bare list of the pictures in a directory in a file
named "index.htm", this next macro can turn it into a simple webpage:
/*******************************************************************
* Script to create a web page from the pictures in a directory.
*
* Create index.htm by selecting any file and running HtmlPage1
*
* Edit index.htm and run HtmlPage2 to turn it into a webpage
*
* Further edit index.htm to change captions and or the title if
necessary.
*
* Upload all pictures and the index.htm in that folder to a new
folder
* on your website.
*
* Warren Porter 08/24/2007
*
*******************************************************************/


proc main()
lReplace("^.*$",'<img src="\0"><br>\0<br>',"gnx")
BegFile()
InsertLine("<html><head><title>Pictures</title></head>")
AddLine('<body bgcolor="#FFFFF8"><center>')
EndFile()
AddLine("</center></body></html>")
// SaveAndQuitFile()
// AbandonEditor()
end

My problem is in CREATING that list, but that's in another thread.

knud van eeden

unread,
Feb 2, 2010, 6:24:43 PM2/2/10
to sem...@googlegroups.com
Quick thought:

Just run the "capture.mac" macro.

menu Macro > Execute then type

 capture dir c:\*.jpg

that will load in the editor a listing of all .jpg files in c:\.

In a macro itself you can use

 ExecMacro( "capture dir c:\*.jpg" )

then edit that page further.

And so on...

with friendly greetings,
Knud van Eeden

Reply all
Reply to author
Forward
0 new messages