This question is answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 13 - Pages: 1 - Last Post: 28 Sep 22, 13:04 Last Post By: AndreWolff Threads: [ Previous | Next ]
MarkusD

Posts: 699
Registered: 13-Apr-2006
Copy file to output folder, how to?
Posted: 27 Sep 22, 18:41
 
  Click to reply to this thread Reply
Hi,

is there a way to copy a file (in this case "points.js") from a picture folder (the source) to the output folder?

Source file (lying in the folder with the pictures included in the project):
D:\Eigene Dateien\MDrück\Pictures\2022 03 01 Norge\2022 03 01 Hahnstätten - Malmö\points.js
D:\Eigene Dateien\MDrück\Pictures\2022 03 01 Norge\2022 03 02 Malmö - Sunne\points.js
D:\Eigene Dateien\MDrück\Pictures\2022 03 01 Norge\2022 03 03 Sunne - Östersund\points.js
...


Output folder:
F:\My Albums\Master\Norge, Sverige, Danmark, Suomi\2022 03 01 Norge\2022 03 01 Hahnstätten - Malmö
F:\My Albums\Master\Norge, Sverige, Danmark, Suomi\2022 03 01 Norge\2022 03 02 Malmö - Sunne
F:\My Albums\Master\Norge, Sverige, Danmark, Suomi\2022 03 01 Norge\2022 03 03 Sunne - Östersund
...


And these files, of course, should also be uploaded.

I actually need the files where the "index.html" of a folder is.

Thanks.
davidekholm

Posts: 3,651
Registered: 18-Oct-2002
Re: Copy file to output folder, how to?
Posted: 27 Sep 22, 19:14   in response to: MarkusD in response to: MarkusD
 
  Click to reply to this thread Reply
Sure. IO.copyFile does the job
MarkusD

Posts: 699
Registered: 13-Apr-2006
Re: Copy file to output folder, how to?
Posted: 27 Sep 22, 19:28   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
davidekholm wrote:
Sure. IO.copyFile does the job
Just assume I would be able to implement (maybe again with the big assistance from Rob <g>) a tool to copy the file to the output folder. Would that mean that when JA uploads all files to my server that these files would get uploaded automatic? Thanks.
AndreWolff

Posts: 1,156
Registered: 14-Dec-2007
Re: Copy file to output folder, how to?
Posted: 27 Sep 22, 21:03   in response to: MarkusD in response to: MarkusD
 
  Click to reply to this thread Reply
MarkusD wrote:
is there a way to copy a file (in this case "points.js") from a picture folder (the source) to the output folder?
In my skins are all files in an "out" folder in the image directory automatically copied to the output folder in a Make action.
I did ask for a general solution, see this thread, but that has been refused.

Edited by: RobM on 27 Sep 2022, 20:56
fixed link
davidekholm

Posts: 3,651
Registered: 18-Oct-2002
Re: Copy file to output folder, how to?
Posted: 27 Sep 22, 21:31   in response to: MarkusD in response to: MarkusD
 
  Click to reply to this thread Reply
MarkusD wrote:
davidekholm wrote:
Sure. IO.copyFile does the job
Just assume I would be able to implement (maybe again with the big assistance from Rob <g>) a tool to copy the file to the output folder. Would that mean that when JA uploads all files to my server that these files would get uploaded automatic? Thanks.

Yes, jAlbum simply uploads the contents of the output folder to the designated folder on the server
MarkusD

Posts: 699
Registered: 13-Apr-2006
Re: Copy file to output folder, how to?
Posted: 27 Sep 22, 21:35   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
davidekholm wrote:
MarkusD wrote:
davidekholm wrote:
Sure. IO.copyFile does the job
Just assume I would be able to implement (maybe again with the big assistance from Rob <g>) a tool to copy the file to the output folder. Would that mean that when JA uploads all files to my server that these files would get uploaded automatic? Thanks.

Yes, jAlbum simply uploads the contents of the output folder to the designated folder on the server

Brilliant. So, my idea is, to just write one (Windows) batch file, which copies just all the files affected to the corresponding output folders, and I'm done. Thanks.
davidekholm

Posts: 3,651
Registered: 18-Oct-2002
Re: Copy file to output folder, how to?
Posted: 27 Sep 22, 22:02   in response to: MarkusD in response to: MarkusD
 
  Click to reply to this thread Reply
MarkusD wrote:

Brilliant. So, my idea is, to just write one (Windows) batch file, which copies just all the files affected to the corresponding output folders, and I'm done. Thanks.

Sure you can do that, but isn't that akward when you can use either Java, Groovy, BeanShell or JavaScript to copy those files automatically during album build. Just add a predir or postdir script to the skin you use and add 4 IO.copyFile statements to it.
RobM

Posts: 3,950
Registered: 4-Aug-2006
Re: Copy file to output folder, how to?
Posted: 27 Sep 22, 22:05   in response to: MarkusD in response to: MarkusD
 
  Click to reply to this thread Reply
MarkusD wrote:
davidekholm wrote:
MarkusD wrote:
davidekholm wrote:
Sure. IO.copyFile does the job
Just assume I would be able to implement (maybe again with the big assistance from Rob <g>) a tool to copy the file to the output folder. Would that mean that when JA uploads all files to my server that these files would get uploaded automatic? Thanks.

Yes, jAlbum simply uploads the contents of the output folder to the designated folder on the server

Brilliant. So, my idea is, to just write one (Windows) batch file, which copies just all the files affected to the corresponding output folders, and I'm done. Thanks.
I could code the tool to copy the files to the output directories, if you want. It is not as straightforward as the linked post suggests because it is in a tool not in a script used during album build.
JeffTucker

Posts: 7,926
Registered: 31-Jan-2006
Re: Copy file to output folder, how to?
Posted: 27 Sep 22, 22:27   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
davidekholm wrote:
Sure you can do that, but isn't that akward when you can use either Java, Groovy, BeanShell or JavaScript to copy those files automatically during album build. Just add a predir or postdir script to the skin you use and add 4 IO.copyFile statements to it.

A little tricky in this case because he's using Tiger. There's a predir.js, but no postdir.js. So, easy enough to add a postdir.js - and doing it in "pre" might be problematic (when does the output dir get created?).

I could give him the lines in a postdir.bsh or postdir.groovy, but it would probably take some trial and error to do it in Javascript. ;)
AndreWolff

Posts: 1,156
Registered: 14-Dec-2007
Re: Copy file to output folder, how to?
Posted: 27 Sep 22, 22:36   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
JeffTucker wrote:
A little tricky in this case because he's using Tiger.
That’s why I did ask to implement my out folder concept in The jAlbum part, because in that case it works for all skins.

David may be you should consider it again!
MarkusD

Posts: 699
Registered: 13-Apr-2006
Re: Copy file to output folder, how to?
Posted: 27 Sep 22, 22:41   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
davidekholm wrote:
MarkusD wrote:

Brilliant. So, my idea is, to just write one (Windows) batch file, which copies just all the files affected to the corresponding output folders, and I'm done. Thanks.

Sure you can do that, but isn't that akward when you can use either Java, Groovy, BeanShell or JavaScript to copy those files automatically during album build. Just add a predir or postdir script to the skin you use and add 4 IO.copyFile statements to it.

David, I have to be realistic, I don't speak any Italian (Java), Spanish (Groovy), Hungarian (BeanShell) and only a little bit of JavaScript. :-)

So the good old method with a batch file seemed to be a reasonable workaround. I already started to write it, but indeed, this will be a mess... I have to think about this...
RobM

Posts: 3,950
Registered: 4-Aug-2006
Re: Copy file to output folder, how to?
Posted: 28 Sep 22, 00:23   in response to: MarkusD in response to: MarkusD
 
  Click to reply to this thread Reply
MarkusD wrote:
So the good old method with a batch file seemed to be a reasonable workaround. I already started to write it, but indeed, this will be a mess... I have to think about this...
As posted in the other place, try the new tool which copies the .js file to the output directory.
davidekholm

Posts: 3,651
Registered: 18-Oct-2002
Re: Copy file to output folder, how to?
Posted: 28 Sep 22, 10:15   in response to: AndreWolff in response to: AndreWolff
 
  Click to reply to this thread Reply
AndreWolff wrote:
JeffTucker wrote:
A little tricky in this case because he's using Tiger.
That’s why I did ask to implement my out folder concept in The jAlbum part, because in that case it works for all skins.

David may be you should consider it again!


I will. Can you refer me to your post on that?
AndreWolff

Posts: 1,156
Registered: 14-Dec-2007
Re: Copy file to output folder, how to?
Posted: 28 Sep 22, 13:04   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
davidekholm wrote:
AndreWolff wrote:
JeffTucker wrote:
A little tricky in this case because he's using Tiger.
That’s why I did ask to implement my out folder concept in The jAlbum part, because in that case it works for all skins.

David may be you should consider it again!

I will. Can you refer me to your post on that?


Do you mean this thread?
Legend
Forum admins
Helpful Answer
Correct Answer

Point your RSS reader here for a feed of the latest messages in all forums