Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk® Softimage® / XSI SDK / Running a script from within a toolbar button
  RSS 2.0 ATOM  

Running a script from within a toolbar button
Rate this thread
 
30184
 
Permlink of this thread  
avatar
  • sfu_Pete
  • Posted: 01 April 2009 01:21 PM
  • Total Posts: 105
  • Joined: 09 March 2008 09:57 PM

Running ScriptsHi there,

Sorry I know this is a bit of a naff question but I can’t figure it out…

I’m trying to run a script from within a toolbar button so I can modify the script externally and the button will always be running the current script file.

I found this in the docs, but no info on how to do it??
• You can create a custom command to run a script from a button on a custom toolbar.



Replies: 0
avatar

Did you look in the docs for information about Custom Commands and how to create them?

Eric T.



Replies: 0
avatar
  • sfu_Pete
  • Posted: 01 April 2009 01:58 PM

Well i don’t really want to make a Custom Command just yet,
I’d just like to run this script I’m working on externally. Is that possible?

RunScript “C:\Softimage\XSI_7.01\Data\XSI_SAMPLES\Scripts\test.vbs”

I guess it’s not that easy?



Replies: 0
avatar

Don’t sure how about toolbars, but on shelf just drag file from browser and you get ‘Add Script Command’



Replies: 0
avatar
  • sfu_Pete
  • Posted: 01 April 2009 09:32 PM

Ahh great, thanks streaker that’s exactly what I need!!! It did come back with a bit of an error at the start…

‘ ERROR : 2000 - File not found - C:\Softimage\XSI_7.01\Application\DSScripts\Body Simple.vbs
BodySimple

but you just have to point it in the right direction and it works fine for the time being!

Thanks



Replies: 0
avatar

Here try this

[INDENT]sub Execute
‘Points to the file is
filepath = Directory & File
‘Scripting Language: “Python” - “VBScript” - “JScript”
Language = “VBScript”
ExecuteScript filePath, Language
end sub

Directory = “\Data\Scripts\Biped\”
File = “script.vbs”
Execute
[/INDENT]



Replies: 0