ThumbsPlus
All forums => ThumbsPlus v7-v9 Questions => Topic started by: webazubi on 2017-01-31 19:15:12
-
Hello.
I search for a variabe for Gallery, because I want to start a batch file from a gallery that produce a webpage.
No problem to make a webpage by batch from actual folder by writing:
set /p Ordner=Ordner:%=%
for /f "tokens=2,*" %%i in ('dir /a:d ') do if "%%i"=="von" set "AKTPFAD=%%j"
tpcmd WebPages(mypage;%AKTPFAD%\%Ordner%;%AKTPFAD%;0;WAIT)
This code takes all images from the folder where I start the batch from and put the webpage in another folder.
But I am in a gallery, because I want to order the images manually before I make the webpage.
I need the name / variabel where the Gallery-Sorting is saved.
Can someone help me?
-
Hi webazubi,
(I've moved this to the "ThumbsPlus v8 or earlier" section because as far as I know, v7 sp2 is the last version that would work with TPCMD.EXE)
> I search for a variabe for Gallery, because I want to start a batch file from a gallery that produce a webpage.
I don't know about such a variable. In .TDO-files, galleries are refered to by "/G". Could that be what you need? For example:
Folder_000=E:\Foto
Folder_001=/GHolidays
Folder_002=/G(Tagged Images)
> tpcmd WebPages(mypage;%AKTPFAD%\%Ordner%;%AKTPFAD%;0;WAIT)
(just curious: how did you know about the WebPages command? It's not officially documented anywhere that I know of!)
> Can someone help me?
I can't really, but I did find a fascinating comment in the old Usenet groups. Someone posted this bug report in 2004:
"I have found that if you have T+ open at a specific gallery, and then run tpcmd asking the webwizard to create pages based on that same gallery, nothing is created. You have to have T+ pointing at another gallery or folder before you run tpcmd and then it works....
This also of course fails if you have shut T+ whilst pointing at the specific gallery and T+ has saved the last browsed folder in the ini file"
Could that explain why it hasn't worked for you? There were no responses to this message and I found no further references about accessing galleries from TPCMD.
-
Hello.
Thanks for the answer.
I will test the /G-Parameter next days. First test is failed.
But I ' ve got another idea, that works.
Just make a webpage by wizard, write a real path for
ImageFolder=C:\temp\thumbs
ThumbnailFolder=C:\temp\thumbs
OutputPath=C:\temp\thumbs
and also
SelectOnly=1
Then save this template and run a batch that search and change the output paths like:
set /p Ordner=Ordner:%=%
@ECHO off
SETLOCAL enabledelayedexpansion
for /f "tokens=2,*" %%i in ('dir %* ') do if "%%i"=="von" set "AKTPFAD=%%j"
SET "quell_datei=D:\vorlagen\thumbs\web_scheme\test1701.tp_webwiz"
SET "ziel_datei=D:\vorlagen\thumbs\web_scheme\test1701_temp.tp_webwiz"
SET "suchen_nach=C:\temp\thumbs"
SET "ersetzen_durch=%AKTPFAD%\%Ordner%"
IF NOT DEFINED suchen_nach (ECHO Fehler: Die Variable suchen_nach nicht definiert^^!&GOTO :eof)
IF EXIST %ziel_datei% (DEL /f %ziel_datei% 1>NUL 2>NUL)
FOR /f "delims=" %%i IN ('FINDSTR . "%quell_datei%"') DO (
SET zeile=%%i& CALL :ersetzen !zeile!
)
GOTO :weiter
:ersetzen
SET zeile=!zeile:%suchen_nach%=%ersetzen_durch%!
IF [!zeile!] EQU [] (ECHO.>>%ziel_datei%) ELSE (ECHO !zeile!>>%ziel_datei%)
GOTO :eof
:weiter
tpcmd WebPages(test1701_temp)
Ergo: Thumbs takes the original folder of the images and takes the manual order from Gallery!
>how did you know about the WebPages command?
In Thumbs Help you can read here:
Additional References > DDE commands > DDE, WebPages
WebPages
Executes a defined Web Page Wizard scheme.
Syntax
WebPages(scheme-name;output-path;input-path;selection-option;wait-flag)
Abbreviation
WP(scheme-name;output-path;input-path;selection-option;wait-flag)
Parameters
scheme-name
This value can be any web page wizard scheme name defined in ThumbsPlus.
Optional Parameters
output-path
The complete folder path where ThumbsPlus will create the generated HTML and graphics files.
input-path
The complete folder path where ThumbsPlus will look for the input files.
selection-option
0 - Selected files
1 - Current folder
wait-flag
WAIT - Wait for web page task to complete before returning.
(empty) - Do not wait for task completion - return immediately.
Examples
WebPages(ALASKA)
Calls the WebPage Wizard scheme named ALASKA, using all scheme settings.
WebPages(VACATION;C:\WebPages\Vacation;D:\Images\Vacation;1;WAIT)
Calls the scheme VACATION with the specified overrides.
-
Good to hear that you found a work-around!
The interesting thing is that the 'WebPages' DDE command was introduced in 2003, a year after the last TPCMD.EXE was made. But TPCMD supports it anyway! :)
I found one more newsgroup message about using de WebPages dde command with a gallery. I don't think it will help you, but I'm adding it here just in case someone else could use it in the future:
I generate from Microsoft Access with DDE Thumbs-webpages like this way:
WebPages(VACATION;C:\WebPages\Vacation;D:\Images\Vacation;1;WAIT)
or for my example, after setting the variables for Input- and Outputpathes:
"[WebPages(VACATION;" & Online_Dats & ";" & Offline_Dats & ";1;Wait)]"
That works!
Now I want to generate Galleries to webpages in the same way. But it seems
that Thumbs only wants to have a specific path in the WebPages-DDE-Command.
Or is there a way to send Galleries over DDE?
The poster then answered his own message (this only works when TP is running when you issue the dde command):
Found a solution. Not very comfortable, but it works.
The following string works from Access, if the cursor in Thumbs stands on
the wanted gallery and if the Offline-Dats-Variable ist empty.
"[WebPages(VACATION;" & Online_Dats & ";" & Offline_Dats & ";1;Wait)]"
-
Thats one of the reasons I like ThumbsPlus: Because of the possibility to work with Access or SQL.
Specially in building WebPages, because sometimes I like to put a html- formular field under the image so that it's possible to choose images by clicking a checkbox and send this selection with php per E-Mail. Thats only with Access possible, because the name of the image must be placed in the html-Code.
But I don't want to start always Access for some little works. So I hope that the Programmers will include somemore functions in normal thumbs-program that are now only with Access possible.