-
Notifications
You must be signed in to change notification settings - Fork 0
/
js_hashRenameUI.mel
45 lines (34 loc) · 1.04 KB
/
js_hashRenameUI.mel
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
/*
Script: js_hashRenameUI
Version: 1.0
Author: Jason Schleifer
Website: http://jonhandhisdog.com
Descr: Works with js_hashRename to rename objects replacing the ### marks with numbers.
Requires: js_hashRename.mel
*/
global proc js_hashRenameUI ()
{
// bring up an interface for hashRename
$win = "js_hashRename";
if (`window -exists $win`)
deleteUI $win;
window -title "Hash Rename" $win;
columnLayout -adj true -co "both" 10 ;
text -align "left" -l "New Name: (example: name####me)";
$searchTextGrp = `textField -tx ""`;
textField -e -cc ("js_prepHashRename \"" + $searchTextGrp +"\"") $searchTextGrp;
showWindow $win;
}
global proc js_prepHashRename (string $stg)
{
// get the results
string $search;
$search = `textField -q -tx $stg`;
if ($search != "")
{
$cmd = ("js_hashRename \"" + $search + "\"");
evalEcho $cmd;
textField -e -tx "" -ip 1 $stg;
evalDeferred ("setFocus \""+$stg+"\"");
}
}