T
Tank
First off let me say that I am by no means a skilled programmer so i
probably have made a dozen mistakes in my attempt at coding my
problem. I will tell you the problem so that you have an idea of what
i am trying to do and I will give you my code so you can see my
clusterf*ck.
Here is the problem:
At work I have about 20 photographers who work for me. Each one has a
photo idea number (mine is 102 and my bosses is 101 and my assistant's
is 103 etc.) When they take a picture they give a card to the guest
and then when they have filled up thier memory cards they return to
the office to load thier pictures.
The pictures get loaded into thier own folders. Each photographer has
5000 folders to work from. they drag one picture labeled
"dscfxxxx.jpg" (x = 0000 which counts up as each pisture is taken)
into the lowest unfilled folder (1020001, 1020002, etc.) and then puts
those folders on the server. the guest comes to the counter and
enters thier number on the screen and the image within the folder of
the number entered is then pulled up.
Working with so many images and folders leads to mistakes and
frequently guests enter numbers that do not match up to the picture of
them. This is because the photographer accidentally put it in the
wrong folder or handed out the wrong card. I can not deal with
handing out the wrong card as mistakes happen but i know it can be
programmed to automattically take the pictures from the media card,
create a folder and then transfer the picture to that folder.
My solution and my problem:
I have written a javascript that is very ugly--
<script language="javascript">
/*alows user to input starting folder and amount of photos taken and
then makes them into numbers*/
folder = window.prompt('starting folder','default');
picnumber = window.prompt('pictures taken?','default');
f2 = parseFloat(folder);
p2 = parseFloat(picnumber);
/*adds the amount of photos taken to the starting folder number to
ensure proper amount of folders are present and tells user what the
starting folder and end folders are*/
varAdd = f2+p2-1;
varImg = 0000+p2;
document.write('Starting folder is ',f2,'<br>');
document.write("Ending folder should be " + varAdd + "<br><br>");
/*Commands used to bring system to standard for file transfer*/
document.write("cd..<br>")
document.write("cd documents and settings\christopher
neu\desktop<br>")
document.write("mkdir transfer<br>")
document.write("cd transfer<br>")
/*copies files from smartmedia to transfer folder*/
document.write('copy d:\dcim\100_fuji\*.jpg<br>')
/*calculates and writes proper amount of folders in the transfer
folder via the "mkdir" command to properly transfer files*/
for (count=f2;count<=varAdd;count++)
document.write("mkdir " + count +"<br>");
/*moves pictures into proper folders*/
for (count=p2;count<=varImg;count++)
document.write("move dscf" + count +".jpg <br>")
</script>
--this script successfully allows the photographer to input what
folder number they started on and how many photos they took then
creates the proper amount of folders so each pictures has its own
folder. I then am trying to have the script create the proper
commands to move each photo to its equivalent folder. dscf0001.jpg to
the lowest available folder dscf0002.jpg to the next lowest etc.
here is the problem with that step:
I am trying to have it sequence out the proper number of images by
counting starting with 0000 and adding the number of photos taken and
then combining it onscreen with the text "dscf" and ".jpg" so that it
reads "dscf0001.jpg" but it keeps dropping the extra zeros and gives
me "dscf1.jpg"
Once it is done running the photographer will copy the command text
and paste it to the dos command line and it will move every picture to
its correct folder for them eliminating a major area of mistake that
has cost us a tone of sales because people are like,"well it is no
biggie. Don't worry about finding it."
I am also having the problem of displaying the slashes in the change
directory commands. they are just eliminated and i am not sure how to
make them appear.
If someone can help me with this it will be greatly appreciated!
P.S. sorry this is sol drawn out and not really straight to the point
but i am a firm believer that backstory of the problem brings about a
much swifter solution.
probably have made a dozen mistakes in my attempt at coding my
problem. I will tell you the problem so that you have an idea of what
i am trying to do and I will give you my code so you can see my
clusterf*ck.
Here is the problem:
At work I have about 20 photographers who work for me. Each one has a
photo idea number (mine is 102 and my bosses is 101 and my assistant's
is 103 etc.) When they take a picture they give a card to the guest
and then when they have filled up thier memory cards they return to
the office to load thier pictures.
The pictures get loaded into thier own folders. Each photographer has
5000 folders to work from. they drag one picture labeled
"dscfxxxx.jpg" (x = 0000 which counts up as each pisture is taken)
into the lowest unfilled folder (1020001, 1020002, etc.) and then puts
those folders on the server. the guest comes to the counter and
enters thier number on the screen and the image within the folder of
the number entered is then pulled up.
Working with so many images and folders leads to mistakes and
frequently guests enter numbers that do not match up to the picture of
them. This is because the photographer accidentally put it in the
wrong folder or handed out the wrong card. I can not deal with
handing out the wrong card as mistakes happen but i know it can be
programmed to automattically take the pictures from the media card,
create a folder and then transfer the picture to that folder.
My solution and my problem:
I have written a javascript that is very ugly--
<script language="javascript">
/*alows user to input starting folder and amount of photos taken and
then makes them into numbers*/
folder = window.prompt('starting folder','default');
picnumber = window.prompt('pictures taken?','default');
f2 = parseFloat(folder);
p2 = parseFloat(picnumber);
/*adds the amount of photos taken to the starting folder number to
ensure proper amount of folders are present and tells user what the
starting folder and end folders are*/
varAdd = f2+p2-1;
varImg = 0000+p2;
document.write('Starting folder is ',f2,'<br>');
document.write("Ending folder should be " + varAdd + "<br><br>");
/*Commands used to bring system to standard for file transfer*/
document.write("cd..<br>")
document.write("cd documents and settings\christopher
neu\desktop<br>")
document.write("mkdir transfer<br>")
document.write("cd transfer<br>")
/*copies files from smartmedia to transfer folder*/
document.write('copy d:\dcim\100_fuji\*.jpg<br>')
/*calculates and writes proper amount of folders in the transfer
folder via the "mkdir" command to properly transfer files*/
for (count=f2;count<=varAdd;count++)
document.write("mkdir " + count +"<br>");
/*moves pictures into proper folders*/
for (count=p2;count<=varImg;count++)
document.write("move dscf" + count +".jpg <br>")
</script>
--this script successfully allows the photographer to input what
folder number they started on and how many photos they took then
creates the proper amount of folders so each pictures has its own
folder. I then am trying to have the script create the proper
commands to move each photo to its equivalent folder. dscf0001.jpg to
the lowest available folder dscf0002.jpg to the next lowest etc.
here is the problem with that step:
I am trying to have it sequence out the proper number of images by
counting starting with 0000 and adding the number of photos taken and
then combining it onscreen with the text "dscf" and ".jpg" so that it
reads "dscf0001.jpg" but it keeps dropping the extra zeros and gives
me "dscf1.jpg"
Once it is done running the photographer will copy the command text
and paste it to the dos command line and it will move every picture to
its correct folder for them eliminating a major area of mistake that
has cost us a tone of sales because people are like,"well it is no
biggie. Don't worry about finding it."
I am also having the problem of displaying the slashes in the change
directory commands. they are just eliminated and i am not sure how to
make them appear.
If someone can help me with this it will be greatly appreciated!
P.S. sorry this is sol drawn out and not really straight to the point
but i am a firm believer that backstory of the problem brings about a
much swifter solution.