Notifications
Clear all

[Closed] Exposing a value for editing

Hi all,
I hope you are well, I wonder if you can help me?
I have written a script to launch a program via a DOS command which sends info to a given IP address.I have listed a destination IP Address but I would like to expose it for user input. so the user is able to change and updatethe script with a new value/ip
I’ve had a look at the helper files with Max 8 and several websites (Scriptspot being one).

Thanks for any help you can give.

[size=1]
resetMaxFile #noPrompt
-- FUNCTION DECLARATIONS
fn Stretcher arg = 
(
addModifier arg (stretch stretch:0.0)
animateon
(
at time 0 (arg.stretch.stretch = 0.0; arg.stretch.amplify = 0.0)
at time 50 (arg.stretch.stretch = -1.0; arg.stretch.amplify =-20.0)
at time 100 (arg.stretch.stretch = 0.0; arg.stretch.amplify =0.0)
)
)
-- USER INTERFACE ITEMS
FirstDialog = newRolloutFloater "art plugin test" 250 175
rollout FirstRollout "Please Enter IP "
(
editText ip_add "IP Address:" text:"**..." fieldwidth:90 align:#left type:#integer enable:false
editText Port_No "Port:" text:"*" fieldwidth:30 align:#right type:#integer enable:false
button btn_one "Update IP" \
tooltip: "Press this button to confirm set IP address" \
on btn_one pressed do
--this will edit the ip address the Util sends the file format file to
(
btn_one.enabled = true
)
)
rollout SecondRollout "launch:"
(
button go_away "Preview"
tooltip: "This will launch the Util" \
on go_away pressed do
(
viewTM=inverse (viewport.gettm())
newcamName=uniquename "ViewCamera"
newcam=targetcamera transform:viewTM name:newcamName viewport.setCamera newcam --
exportFile "C:/temp.dae" #noPrompt
DOSCommand "C:/%/%/%/%/%/Utils.exe **... * c:/file.*"-- this launches a exe, sending the file to the listed IP Address
select $ViewCamera***
actionMan.executeAction 0 "40020"-- Edit: Delete Objects
max delete
)
)
addrollout FirstRollout FirstDialog
addrollout SecondRollout FirstDialog

[/size]

2 Replies

Basically your best bet would be to save an .INI file with that information. Look in the reference for getINISetting [font=Verdana]and setINISetting. [/font]It’s pretty straight forward to set up.

Brilliant! thanks for the heads up, anton