Hey guys,
I've wrote a script that I'm trying to get to work where it shows loading bars for all the different script and templates. The reason for this is that there are so many files that this can take a little while to do and this will let the user see something working other then illustrator just locking up for a little while. Below is one section of the code that will run if you want to try and test it. Maybe I'm just using MATH.ceil wrong.
#target illustrator //Script Name: Fill Template Arrays //Script Version: 1.0.0 //Script Description: 1. This script will populate all the arrays that are used by the template scripts // 2. This process used to have to load when the script for each template script was ran // 3. This should reduce the total amount of time needed to do the artists jobs //Script Parent: Script Pallet //Script Author: Zantcor //Scripted Created: April 30th, 2015 //Script last edited: //Script edited by: //Script Owner: Zantcor //Progress Bar to show loading of templates var win = new Window("palette", "Loading Templates and Prepareing Scripts"); win.pnl = win.add("panel",undefined, "Script Progress"); totalprogBar = win.pnl.add('progressbar', [20, 35, 410, 60], 0, 100); totalprogBarLabel = win.pnl.add("statictext", [20, 20, 320, 35], " Total - Not Loading"); totesprogBar = win.pnl.add('progressbar', [20, 35, 410, 60], 0, 100); totesprogBarLabel = win.pnl.add("statictext", [20, 20, 320, 35], " Totes - Not Loading"); UmbrellaprogBar = win.pnl.add('progressbar', [20, 35, 410, 60], 0, 100); UmbrellaprogBarLabel = win.pnl.add("statictext", [20, 20, 320, 35], " Umbrella - Not Loading"); CalendarprogBar = win.pnl.add('progressbar', [20, 35, 410, 60], 0, 100); CalendarprogBarLabel = win.pnl.add("statictext", [20, 20, 320, 35], " Calendar - Not Loading"); win.show(); getToteTempNames () alert('Done!'); function getToteTempNames() { //Replace this address for the "toteTempPath" to the folder that has all the templates it in it, then the for loop will place them all //into a radio button array for the user to choose which one they want. This updates everytime that this script is ran so if //one if removed or added it will show up reducing the amount of required time needed to update the script. //when replaced make sure to change the \ marks to / marks or it will not work. var toteTempPath = Folder ("S:/Art/ArtDept/ Vitronic Master Templates/STE2 Templates/TOTES & BAGS"); var toteTempFiles = toteTempPath.getFiles(); var TotenamesArr = []; for(var i=0; i<toteTempFiles.length; i++) { var thisToteFile = toteTempFiles[i]; TotenamesArr.push(thisToteFile.displayName); var totepercent = MATH.ceil (toteTempFiles.length / [i]); var totetempname = toteTempFiles[i]; totesprogBar.value = totepercent totesprogBarLabel.text = ("Loading Totes - " + totesprogBar.value+"%" + " filename: " + totetempname); totalprogBar.value = 56 totalprogBarLabel.text = ("TOTAL - " + totalprogBar.value+"%"); } return TotenamesArr; }