Created
September 9, 2020 14:00
-
-
Save miura/3e6998599a7db63125e8ebaf694ca232 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//20200909 Kota Miura | |
// temporal colorcode fix | |
testpath = "/Users/miura/Desktop/tmp/rewritemacro/Temporal-Color_Code.ijm"; | |
ijmpath = testpath; | |
ijpluginDir = getDir("plugins"); | |
thefile = ijpluginDir + "Scripts/Image/Hyperstacks/Temporal-Color_Code.ijm"; | |
ijmpath = thefile; | |
if ( File.exists(ijmpath) ){ | |
createMacroBackup( ijmpath ); | |
str = File.openAsString( ijmpath ); | |
str = replace(str, "lutA = makeLUTsArray\\(\\)", "lutA = getList\\(\"LUTs\"\\)"); | |
File.saveString(str, ijmpath); | |
} else { | |
print( ijmpath ); | |
print("...that file seems to be not existing. Please check the path"); | |
} | |
function createMacroBackup( path ){ | |
filename = File.getNameWithoutExtension(path); | |
dirname = File.getDirectory(path); | |
backuppath = dirname + filename + "-backup.macro"; | |
print( "Backup:", backuppath); | |
File.copy(path, backuppath); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment