1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444
|
// ******************************************************************
// ADOBE JSX SCRIPT TO CREATE 'FOLDER TREE' FOR A DIGITAL PHOTO SHOOT
// CROSS PLATFORM - WINDOWS / OS X
// VERSION 2.2 - COPYRIGHT : YOHAN BUREL
// ******************************************************************
// --- BEGIN SCRIPT ---
// start FOR loop to restart in case of error
for (var restart = 1; restart != 0;){
restart = 0; // set termination variable to exit loop if not toggled to "on"
// CREATE INFORMATION WINDOW
var dlgs = new Window('dialog', 'PARDON MY FRENCH - D I G I T A L');
// ADD PANEL FOR FOLDER INFORMATION
dlgs.msgPnl = dlgs.add('panel', undefined, 'Info Opérateur Numérique');
dlgs.msgPnl.alignChildren = "right";
na = dlgs.msgPnl.add('group');
comp = dlgs.msgPnl.add('group');
na.st = na.add('statictext', undefined, 'Nom-Prénom:');
na.et = na.add('edittext', undefined, '');
na.et.preferredSize = [350,20];
comp.st = comp.add('statictext', undefined, 'Nom Entreprise:');
comp.et = comp.add('edittext', undefined, 'Pardon My French');
comp.et.preferredSize = [350,20];
var bolUserCancel = true;
dlgs.buttons2 = dlgs.add('group');
dlgs.buttons2.btnClose = dlgs.buttons2.add("button",undefined , "Next" );
dlgs.buttons2.btnClose.onClick = function() { bolUserCancel = false; dlgs.close(0); };
dlgs.buttons2.btnCancel = dlgs.buttons2.add("button",undefined , "Cancel" );
dlgs.buttons2.btnCancel.onClick = function() { dlgs.close(0); };
dlgs.show();
// GET TODAY'S DATE FOR USE IN THE SCRIPT
today = new Date();
thisDay = today.getDate();
if(thisDay < 10)
thisDay = "0" + thisDay;
thisMonth = parseInt(today.getMonth()) + 1;
if(thisMonth < 10)
thisMonth = "0" + thisMonth;
thisYear = today.getYear();
thisYear = thisYear.toString();
thisYear = thisYear.substr(thisYear.length-2,thisYear.length);
today = "20"+thisYear + "_" + thisMonth + "_" + thisDay;
yearmonth = thisMonth + "-" + thisYear;
// CREATE WINDOW
var dlg = new Window('dialog', 'PARDON MY FRENCH - D I G I T A L');
// ADD PANEL FOR FOLDER INFORMATION
dlg.msgPnl = dlg.add('panel', undefined, 'DOSSIERS DE SHOOTS');
dlg.msgPnl.alignChildren = "right";
dat = dlg.msgPnl.add('group');
client = dlg.msgPnl.add('group');
story = dlg.msgPnl.add('group');
talent = dlg.msgPnl.add('group');
loc = dlg.msgPnl.add('group');
numberoffolders = dlg.msgPnl.add('group');
numberoffolders=dlg.msgPnl.add('group');
dat.st = dat.add('statictext', undefined, 'DATE:');
dat.et = dat.add('edittext', undefined, today);
dat.et.preferredSize = [50,20];
client.st = client.add('statictext', undefined, 'PHOTOGRAPHE:');
client.et = client.add('edittext', undefined, '');
client.et.preferredSize = [100, 20];
story.st = client.add('statictext', undefined, 'CLIENT:');
story.et = client.add('edittext', undefined, '');
story.et.preferredSize = [100, 20];
talent.st = client.add('statictext', undefined, 'TYPE DE JOB:');
talent.et = client.add('edittext', undefined, '');
talent.et.preferredSize = [100, 20];
loc.st = client.add('statictext', undefined, 'LIEU:');
loc.et = client.add('edittext', undefined, '');
loc.et.preferredSize = [50, 20];
numberoffolders.st = numberoffolders.add('statictext', undefined, 'Nombre De Dossiers:');
numberoffolders.et = numberoffolders.add('edittext', undefined, '15');
numberoffolders.et.preferredSize = [40, 20];
// ADD CHECKBOX PANEL FOR FOLDER CREATION TOGGLES
dlg.checks = dlg.add('panel', undefined, "CREATION DE DOSSIERS POUR:");
dlg.checks.alignChildren = "right";
capt = dlg.checks.add('group');
captnikx = dlg.checks.add('group');
archive = dlg.checks.add('group');
devel = dlg.checks.add('group');
namer = dlg.checks.add('group');
psdfold = dlg.checks.add('group');
ret = dlg.checks.add('group');
captnikx.cb = capt.add('checkbox', undefined, "RAW");
captnikx.cb.value = true;
devel.cb = capt.add('checkbox', undefined, "JPEG ");
devel.cb.value = true;
namer.cb = capt.add('checkbox', undefined, "NOMS OPERATEUR ");
namer.cb.value = true;
archive.cb = capt.add('checkbox', undefined, "ARCHIVE");
archive.cb.value = true;
psdfold.cb = capt.add('checkbox', undefined, "MONTAGE SUR SET ");
psdfold.cb.value = true;
ret.cb = capt.add('checkbox', undefined, "RETOUCHE ");
ret.cb.value = true;
dlg.options = dlg.add('panel', undefined, );
dlg.options.alignChildren = "right";
dlg.options.orientation = "row";
majs = dlg.options.add('group');
majs.cb = majs.add('checkbox', undefined, "CONVERT INTO CAPITAL LETTERS ");
majs.cb.value = true;
var bolUserCancel = true;
dlg.buttons2 = dlg.add('group');
dlg.buttons2.btnClose = dlg.buttons2.add("button",undefined , "Next" );
dlg.buttons2.btnClose.onClick = function() { bolUserCancel = false; dlg.close(0); };
dlg.buttons2.btnCancel = dlg.buttons2.add("button",undefined , "Cancel" );
dlg.buttons2.btnCancel.onClick = function() { dlg.close(0); };
// SHOW WINDOW AND WAIT FOR USER INPUT AND CONFIRMATION
dlg.show();
// SIMPLIFY VARIABLE NAMES AND CONVERT TO UPPERCASE IF CHECKED
// date
var datepath = dat.et.text;
// photographe to uppercase
if(majs.cb.value) var clientpath = client.et.text.toUpperCase();
if(!majs.cb.value) var clientpath = client.et.text;
// autres to uppercase
if(majs.cb.value) var talentpath = talent.et.text;
if(!majs.cb.value) var talentpath = talent.et.text;
// client to uppercase
if(majs.cb.value) var storypath = story.et.text;;
if(!majs.cb.value) var storypath = story.et.text;
// lieu to uppercase
if(majs.cb.value) var locpath = loc.et.text;
if(!majs.cb.value) var locpath = loc.et.text;
// name to uppercase
if(majs.cb.value) var napath = na.et.text;
if(!majs.cb.value) var napath = na.et.text;
// company to uppercase
if(majs.cb.value) var comppath = comp.et.text;
if(!majs.cb.value) var comppath = comp.et.text;
// CONVERT FOLDERS STRING TO INTEGER
var folderslimit = parseInt(numberoffolders.et.text);
// CREATE PATHS VARIABLES
var captPath = null;
var captSubPath = null;
var choicesPath = null;
var devPath = null;
var namePath = null;
var setPath = null;
var psdPath = null;
var trashPath = null;
var captGrayPath = null;
var captTestPath = null;
var devTestPath = null;
var retPath = null;
var trashPath = "TRASH";
var testPath = "TEST";
// START OF IF ROUTINES FOR CANCELLING PROCESSING IN VARIOUS SITUATIONS
if( datepath != "" && clientpath != "" )
{
if( !bolUserCancel ) // process if dialogue NOT cancelled
{
// SELECT DESTINATION PATH
var destpath = Folder.selectDialog ("SELECT THE DESTINATION FOLDER ") ;
if (destpath != null) // only process if user does not cancel
{
// DETERMINE SHOOT PATH
if( storypath == "" && clientpath != "" && talentpath != "" && locpath != "" )
{ var shootpath = destpath + "/" + datepath + "_" + clientpath + "_" + talentpath + "_" + locpath;
var shootpathTest = new Folder(shootpath);
}
if( storypath != "" && clientpath != "" && talentpath =="" && locpath != "" )
{ var shootpath = destpath + "/" + datepath + "_" + clientpath + "_" + storypath + "_" + locpath;
var shootpathTest = new Folder(shootpath);
}
if( storypath == "" && clientpath != "" && talentpath =="" && locpath != "" )
{ var shootpath = destpath + "/" + datepath + "_" + clientpath + "_" + locpath ;
var shootpathTest = new Folder(shootpath);
}
if( storypath != "" && clientpath != "" && talentpath !="" && locpath != "" )
{ var shootpath = destpath + "/" + datepath + "_" + clientpath + "_" + storypath + "_" + talentpath + "_" + locpath;
var shootpathTest = new Folder(shootpath);
}
if( storypath == "" && clientpath != "" && talentpath != "" && locpath == "" )
{ var shootpath = destpath + "/" + datepath + "_" + clientpath + "_" + talentpath;
var shootpathTest = new Folder(shootpath);
}
if( storypath != "" && clientpath != "" && talentpath =="" && locpath == "" )
{ var shootpath = destpath + "/" + datepath + "_" + clientpath + "_" + storypath;
var shootpathTest = new Folder(shootpath);
}
if( storypath == "" && clientpath != "" && talentpath =="" && locpath == "" )
{ var shootpath = destpath + "/" + datepath + "_" + clientpath;
var shootpathTest = new Folder(shootpath);
}
if( storypath != "" && clientpath != "" && talentpath !="" && locpath == "" )
{ var shootpath = destpath + "/" + datepath + "_" + clientpath + "_" + storypath + "_" + talentpath;
var shootpathTest = new Folder(shootpath);
}
// START PROCESSING
if (!shootpathTest.exists) // only process if path doesn't exist
{
Folder(shootpath).create(); // create shoot path
// CREATE NIKON D3x CAPTURE PATHS AND SUBPATHS
if (captnikx.cb.value){
captPath = shootpath + "/" + "RAW";
Folder(captPath).create(); // create capture path
// 'FOR' ROUTINE FOR NUMBERED SUBPATHS
for (var i = 1 ; i <= folderslimit ; i++)
{
if (i < 10)
{
captSubPath = captPath + "/" + "0" + i + "0" + "-" + "RAW";
Folder(captSubPath).create();
}
if (i >= 10)
{
captSubPath = captPath + "/" + i + "0" + "-" + "RAW";
Folder(captSubPath).create();
}
}
captTrashPath = captPath + "/" + trashPath + "-" + "RAW";
Folder(captTrashPath).create();
captTestPath = captPath + "/" + testPath + "-" + "RAW";
Folder(captTestPath).create();
}
// CREATE ARCHIVE PATHS AND SUBPATHS
if (archive.cb.value){
archivePath = shootpath + "/" + "ARCHIVE";
Folder(archivePath).create(); // create archive path
archivePath = shootpath + "/" + archivePath + "/" + "ARCHIVE-JPEG";
Folder(archivePath).create(); // create archive path
archiveSubPath = archivePath + "/" + "X-JPEG";
Folder(archiveSubPath).create(); // create large archive subpath
archiveSubPath = archivePath + "/" + "XX-JPEG";
Folder(archiveSubPath).create(); // create small archive subpath
archiveSubPath = archivePath + "/" + "XXX-JPEG";
Folder(archiveSubPath).create(); // create final archive subpath
archiveSubPath = archivePath + "/" + "LAYOUT-JPEG";
Folder(archiveSubPath).create(); // create layout archivesubpath
archivePath = shootpath + "/" + "ARCHIVE";
archivePath = shootpath + "/" + archivePath + "/" + "ARCHIVE-RAW";
Folder(archivePath).create(); // create archive path
archiveSubPath = archivePath + "/" + "X-RAW";
Folder(archiveSubPath).create(); // create large archive subpath
archiveSubPath = archivePath + "/" + "XX-RAW";
Folder(archiveSubPath).create(); // create small archive subpath
archiveSubPath = archivePath + "/" + "XXX-RAW";
Folder(archiveSubPath).create(); // create final archive subpath
archiveSubPath = archivePath + "/" + "LAYOUT-RAW";
Folder(archiveSubPath).create(); // create layout archive subpath
archivePath = shootpath + "/" + "ARCHIVE";
archivePath = shootpath + "/" + archivePath + "/" + "ARCHIVE-PRINTED";
Folder(archivePath).create(); // create printed path
archiveSubPath = archivePath + "/" + "PRINTED-JPEG";
Folder(archiveSubPath).create(); // create large printed jpeg subpath
archiveSubPath = archivePath + "/" + "PRINTED-TIFF";
Folder(archiveSubPath).create(); // create large printed tiff subpath
}
// CREATE RETOUCHING PATHS AND SUBPATHS
if (ret.cb.value){
retPath = shootpath + "/" + "RETOUCHING";
Folder(retPath).create(); // create archive path
retSubPath = shootpath + "/" + retPath + "/" + "Jpeg Layout";
Folder(retSubPath).create(); // create archive path
retSubPath = retPath + "/" + "Jpeg Large";
Folder(retSubPath).create(); // create large archive subpath
retSubPath = retPath + "/" + "Jpeg Small";
Folder(retSubPath).create(); // create large archive subpath
retSubPath = retPath + "/" + "PSD";
Folder(retSubPath).create(); // create small archive subpath
retSubPath = retPath + "/" + "TIFF";
Folder(retSubPath).create(); // create final archive subpath
retSubPath = retPath + "/" + "TIFF Layout";
Folder(retSubPath).create(); // create final archive subpath
}
// CREATE CHOICES PATHS AND SUBPATHS
// CREATE DEVELOPEMENT PATHS AND SUBPATHS
// CREATE NIKON D3x DEVELOPEMENT PATHS AND SUBPATHS
if (devel.cb.value && captnikx.cb.value){
devPath = shootpath + "/" + "JPEG";
Folder(devPath).create(); // create development path
// 'FOR' ROUTINE FOR NUMBERED SUBPATHS
for (var i = 1 ; i <= folderslimit ; i++)
{
if (i < 10)
{
devSubPath = devPath + "/" + "0" + i + "0" + "-" + "JPEG";
Folder(devSubPath).create();
}
if (i >= 10)
{
devSubPath = devPath + "/" + i + "0" + "-" + "JPEG";
Folder(devSubPath).create();
}
}
devTestPath = devPath + "/" + testPath + "-" + "JPEG";
Folder(devTestPath).create();
}
// CREATE NAMES & OPERATOR INFO PATH
if (namer.cb.value)
{
namePath = shootpath + "/" + "NAMES";
Folder(namePath).create();
}
if (napath != "")
{
nameSubPath = namePath + "/" + "2 Digital Tech = " + napath + " - " + comppath;
Folder(nameSubPath).create(); // create large choices subpath
}
if (namer.cb.value)
{
namePath = shootpath + "/" + "NAMES" + "/" + "1 CallSheet";
Folder(namePath).create();
}
// CREATE PSD PATHS
if (psdfold.cb.value){
psdPath = shootpath + "/" + "MISCELLANEOUS";
Folder(psdPath).create();
psdPath = shootpath + "/" + "MISCELLANEOUS" + "/" + "ON SET PSD";
Folder(psdPath).create();
}
} // if path already exists then show alert and restart
else {
alert(shootpath + " existe dÈj!");
if (!bolUserCancel){restart = 1;} // restart script
}
}
else { // if folder selection cancelled, restart
restart = 1;
}
}
} // if formula not complete then show alert and restart
else
{
if (!bolUserCancel) // only disply alert and restart if user did not cancel
{
alert("Remplir tout le formulaire!");
restart = 1; // restart script
}
}
} //end FOR
// OPEN FOLDERS IN FINDER OR EXPLORER
if (!bolUserCancel)
{shootpathTest.execute();}
// *** END SCRIPT *** |
Partager