/* ActionBar Modifier v05, by Rainer M. Engel, 2012 (engel[..]endime.de) * * ActionBar is a plugin created by Jerome Mutterer working in ImageJ/FIJI * http://imagejdocu.tudor.lu/doku.php?id=plugin:utilities:action_bar:start * * optional things, which might come.. (wishes can be mailed, who knows..) * - update operation (like ActionBar_Updater Macro) * - delete/blank button * - create button (wizard) */ print("\\Clear"); print("starting ActionBar Modifier v05.."); print("- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -"); ijDir = getDirectory("imagej"); ActBar = ijDir+"plugins"+File.separator+"ActionBar"+File.separator; listBars= getFileList(ActBar); print("-> starting to print found ActionBars..."); print("///////////////////////////////////////////////////////////"); n = 0; fABars = newArray(); //Array to store found ActionBars for (i=0; i ActionBar operation completed, have a nice day :)"); print("- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -"); } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // ################################################################################ // Open for EDIT ################################################################## //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (mOption == "open for edit") { openBar = ActBar+fABars[CNumber-1]; open(openBar); print("-> ActionBar operation completed, have a nice day :)"); print("- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -"); } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // ################################################################################ // DELETE BAR/CONTENT ############################################################# //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (mOption == "delete bar/content") { yes = getBoolean("Do you really want to delete the ActionBar "+fABars[CNumber-1]+"\nand its icon subfolder?"); if (yes) { //delete ActionBar...................... openBar = ActBar+fABars[CNumber-1]; //print(openBar); delBar = File.delete(openBar); print("-> deletion of Bar: "+delBar+" file deleted"); //scan icon folder and delete all icons shortN = replace(fABars[CNumber-1], ".[a-zA-Z0-9]*$", ""); folderB = ActBar+"icons"+File.separator+shortN+File.separator; //print(folderB); listB = getFileList(folderB); //print("Files found: "+listB.length); delC = 0; for (i=0; i icons deleted: "+delC); delFol = File.delete(folderB); print("-> deletion of Fld: "+delFol+" folder deleted"); } print("-> ActionBar operation completed, have a nice day :)"); print("- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -"); } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // ################################################################################ // ################################################################################ // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // ################################################################################ // READ selected ActionBar if (mOption != "run" && mOption != "open for edit" && mOption != "delete bar/content") { ActScr = File.openAsString(ActBar+fABars[CNumber-1]); SRClines= split(ActScr,"\n"); print("-> found "+lengthOf(SRClines)+" lines in ActionBar-Script"); rowsA = newArray(); //Array to store startPoints of found rows rowsO = newArray(); //Array to store endPoints of found rows buttonA = newArray(); //Array to store startPoints of found buttons for (i=0; i.*")){ rowsA = Array.concat(rowsA,i); } else if (matches(SRClines[i], ".*")) { rowsO = Array.concat(rowsO,i); } else if (matches(SRClines[i], "^