Hi,
I have a macro to rename all NCPROGRAMS in tree.
Reset localvars
//Deseja alterar todos os nome dos NCPROGRAMS ?
string yesorno = "Clica SIM, para renomear os Ncprograms" + crlf + "Clica NAO, para cancelar a macro"
bool yes = 0
$yes = QUERY $yesorno
IF yes {
STRING $nombre = ""
INT $COUNT = INPUT "Introduz numero do primeiro programa"
// Nomear todos os Ncprograms ou só os selecionados
string allorno = "Click SIM, para renomear os Ncprograms" + crlf + "Clica NAO, outras opcoes"
bool yes = 0
$yes = QUERY $allorno
IF $yes == 1 {
// Numerar todos os Ncprograms
FOREACH Ncp IN folder ('NCProgram') {
ACTIVATE NCPROGRAM $Ncp.name
STRING NewName = ($nombre + $COUNT)
$COUNT = $COUNT + 1
RENAME NCPROGRAM ; $NewName
}
}
The problem is: this macro rename all programs inside NCPROGRAM tree.
Is it possible rename the programs only inside ACTIVE FORDER ? (Red Arrow)
Thanks in advance
With best regards
Pedro Valente
Solved! Go to Solution.
Solved by Cobra.007. Go to Solution.
Try the following
STRING NewName = ""
STRING Fold = ACTIVE_FOLDER()
FOREACH Ncp IN folder ($Fold) {
ACTIVATE NCPROGRAM $Ncp.name
$NewName = ($nombre + $COUNT)
$COUNT = $COUNT + 1
RENAME NCPROGRAM ; $NewName
Can't find what you're looking for? Ask the community or share your knowledge.