Help ME ! How can i use the edittext in function?


#1

I want to select the input edittext ,and use text in function


	searchme=for i in objects where (MatchPattern i.name pattern:(gg.text)) collect i
	selectmore searchme
	
	for i in selection do(
		selectmore i.children
		)

if i write this in function,there is 【–Unknown property:“text” in undefined】
so how could i can use gg.text in function?
I want to know because I have something else write in fuction,I hope I can get text in this

    function DoSessionMAX2Fbx path silente =
   (

 local filefilter = path+"\*.max"
 format "%" filefilter
 
 files=getFiles filefilter

 local filecount = files.count
 format "读取了文件夹%下的%个文件\n" path filecount
 
 for a in files do
 (
     local ok = OperateMAX2Fbx a silente
 )
   )	

   function OperateMAX2Fbx filefullpathname silente =
 (
format "MAX file:% \n" filefullpathname

if silente != true then
(
	local loadok = loadMAXFile filefullpathname
)
else
(
	local loadok = loadMAXFile filefullpathname quiet:true
)
if loadok != true then
(
   format " reading MAX file:%Failed! \n" filefullpathname
   return false
)
else
(
    format "reading MAX file:%Successful! \n" filefullpathname
)
local savename = getFilenamePath filefullpathname
savename = savename+getFilenameFile filefullpathname

savename = savename+".fbx"

searchme = for i in objects where (matchPattern i.name pattern:(gg.text)) collect i
		 
			for i in selection do
  (
	selectmore i.children
   )
if silente != true then
(
	exportFile savename selectedOnly:on
)
else
(
	exportFile savename #noPrompt selectedOnly:on
)
return true
   )
    rollout test"BatchBip" width:500 height:200    
(	
      editText    SavePath         "" pos:[2,9] width:180 height:23
      button      GetSaveDir       "..." pos:[183,8] width:25 height:24 tooltip:"Set the folder location of the operation "
    
	 button      DoButtonFbx   "export fbx" pos:[160,105] width:95 height:24 tooltip:"Export max to fbx  "
	 edittext    gg    "enter root name" pos:[10,110] width:150 height:24 
	     
	 checkbox silente "FBX no prompt" checked:true
	
    
	
	on DoButtonFbx pressed do
    (
		if SavePath.Text != undefined then
	    (
			DoSessionMAX2Fbx SavePath.Text silente.checked
			
	    )
    )  	
)
        createdialog test 260 170

Thank you my firend


#2
   function OperateMAX2Fbx filefullpathname silente ggtext=
 (
format "MAX file:% \n" filefullpathname

if silente != true then
(
	local loadok = loadMAXFile filefullpathname
)
else
(
	local loadok = loadMAXFile filefullpathname quiet:true
)
if loadok != true then
(
   format " reading MAX file:%Failed! \n" filefullpathname
   return false
)
else
(
    format "reading MAX file:%Successful! \n" filefullpathname
)
local savename = getFilenamePath filefullpathname
savename = savename+getFilenameFile filefullpathname

savename = savename+".fbx"

searchme = for i in objects where (matchPattern i.name pattern:ggtext) collect i
		 
			for i in selection do
  (
	selectmore i.children
   )
if silente != true then
(
	exportFile savename selectedOnly:on
)
else
(
	exportFile savename #noPrompt selectedOnly:on
)
return true
   )
function DoSessionMAX2Fbx path silente =
   (

 local filefilter = path+"\*.max"
 format "%" filefilter
 
 files=getFiles filefilter

 local filecount = files.count
 format "读取了文件夹%下的%个文件\n" path filecount
 
 for a in files do
 (
     local ok = OperateMAX2Fbx a silente
 )
   )
    rollout test"BatchBip" width:500 height:200    
(	
      editText    SavePath         "" pos:[2,9] width:180 height:23
      button      GetSaveDir       "..." pos:[183,8] width:25 height:24 tooltip:"Set the folder location of the operation "
    
	 button      DoButtonFbx   "export fbx" pos:[160,105] width:95 height:24 tooltip:"Export max to fbx  "
	 edittext    gg    "enter root name" pos:[10,110] width:150 height:24 
	     
	 checkbox silente "FBX no prompt" checked:true
	
    
	
	on DoButtonFbx pressed do
    (
		if SavePath.Text != undefined then
	    (
			DoSessionMAX2Fbx SavePath.Text silente.checked gg.text
			
	    )
    )  	
)
        createdialog test 260 170