TW Inline Script to execute a batch file?

51 views
Skip to first unread message

Mike

unread,
Nov 24, 2009, 10:50:53 AM11/24/09
to TiddlyWiki
I have a batch file that creates a JS array which I later use in
another script
(See script here: http://groups.google.com/group/tiddlywiki/browse_thread/thread/1d228ee8add12ad7)

Idea from: http://www.dynamicdrive.com/forums/archive/index.php/t-13488.html

I would like to execute the batch file from inside my TW to refresh
the JS array.
Is this possible? (Using FF3.5 / TW 2.5.3)

Thanks,

Mike

Amzg

unread,
Nov 24, 2009, 4:41:04 PM11/24/09
to TiddlyWiki
http://www.Remotely-Helpful.com/TiddlyWiki/LaunchApplication.html


On Nov 24, 4:50 pm, Mike <eris...@gmail.com> wrote:
> I have a batch file that creates a JS array which I later use in
> another script
> (See script here:http://groups.google.com/group/tiddlywiki/browse_thread/thread/1d228e...)

Mike

unread,
Nov 24, 2009, 4:57:17 PM11/24/09
to TiddlyWiki
I tried LAP earlier this morning and had no luck - but I may have had
an antiquated version. . .
Let me try again and see what happens . . .

Thanks,

Mike

Mike

unread,
Nov 24, 2009, 5:56:07 PM11/24/09
to TiddlyWiki
Works perfect !

Thank You :)

Mike

Mike

unread,
Nov 25, 2009, 8:31:16 AM11/25/09
to TiddlyWiki
Quick Question. . .
Using LaunchApplicationPlugin. . .

When I execute the following .bat
@echo off
GOTO EndComment
11.25.09 Mike Praeuner (www.strm.us)
Purpose: Execute this file, to create an array of images for a folder,
to use inside TW
Source: http://www.dynamicdrive.com/forums/archive/index.php/t-13488.html
:EndComment
if '%1'=='w' (
echo array_home[%i%]='%2'; >> array_home.js
rem echo array_home[%i%]='images/%2'; >> array_home.js
set /a i=i+1
) else (
echo array_home=[]; > array_home.js
set /a i=0
for %%p in (*.jpg, *.gif, *.png) do (
call array_home.bat w %%p
)
set i
set i=
)

On my thumb drive @ ?:\Private\Documents\tw\images\home

It places the output (array_home.js) in the same folder, when I
execute via LaunchApplicationPlugin it place the file on the root of ?:
\ and then does not properly fill in the array. Is this a problem
with the .bat? (I am not a batch file expert)

Thank You,

Mike

Mike

unread,
Dec 5, 2009, 11:48:50 AM12/5/09
to TiddlyWiki
/bump

I have an example of what I am trying to do here (minus
LaunchApplicationPlugin because I haven't figured that part out yet)
http://groups.google.com/group/tiddlywiki/browse_thread/thread/641c9b353b2d8558

The .bat file does launch with this code:
<<LaunchApplicationLink "Refresh Image Root Array" "Program relative
to Tiddly html file" "images/array_root.bat">>
.. .. .. but it executes at the root of my drive instead of in the
folder with the .bat file

Works fine if I execute the .bat file from the directory in windows

Any Suggestions?

Thanks,

Mike P.

Mark S.

unread,
Dec 5, 2009, 1:33:16 PM12/5/09
to TiddlyWiki
As a first step, you could try adding your start directory to the top
of the batch file script. In windows, you have to specify the drive
and path separately, like


D:
cd d:\data\mytiddlywikidirectory\

(Using your dir and path, of course).

If that works, and if you are going to be using the thumb drive on
different machines, then you might need some type of file or machine
existence check at the top of the batch file to help it sort out what
machine you're currently running on and to set the path accordingly.

HTH
Mark



On Dec 5, 8:48 am, Mike <eris...@gmail.com> wrote:
> /bump
>
> I have an example of what I am trying to do here (minus
> LaunchApplicationPlugin because I haven't figured that part out yet)http://groups.google.com/group/tiddlywiki/browse_thread/thread/641c9b...

Mike

unread,
Dec 5, 2009, 1:59:59 PM12/5/09
to TiddlyWiki
Sweet !

That is what I needed :)

I used:
cd %~d0\Documents\tw\images

I appreciate the guidance,

Mike
Reply all
Reply to author
Forward
0 new messages