Message 1 of 5
Calling multiple scripts
Not applicable
09-28-2008
07:57 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
What I am trying to do is create one script that will create a rollout with buttons that will call each of the scripts I have written. In other words I would like to put all of my scripts in one location, then have the main calling script look in that location, find all the maxscript files, then dynamically create a rollout based on how many scripts it found. Below is the code I have so far.
--------------------------------------------------------------------
scriptFiles = getFiles "Z:\Programming Files\MaxScript\*.ms"
rollout scriptBox "ScriptBox"
(
for script in scriptFiles do
(
fileName = getFilenameFile script
button fileName fileName width:80 height:20 align:#center
on fileName pressed do
(
fileIn script
)
)
)
createDialog scriptBox 90 60
--------------------------------------------------------------------
I have written a similar script in MEL and it works fine. However in maxscript I keep getting the following error: error at for, expected <rollout clause>. Does anyone know what is wrong?
--------------------------------------------------------------------
scriptFiles = getFiles "Z:\Programming Files\MaxScript\*.ms"
rollout scriptBox "ScriptBox"
(
for script in scriptFiles do
(
fileName = getFilenameFile script
button fileName fileName width:80 height:20 align:#center
on fileName pressed do
(
fileIn script
)
)
)
createDialog scriptBox 90 60
--------------------------------------------------------------------
I have written a similar script in MEL and it works fine. However in maxscript I keep getting the following error: error at for, expected <rollout clause>. Does anyone know what is wrong?