Notifications
Clear all
[Closed] How copy string to system's clipbard
Jul 16, 2010 10:33 am
Code below shows how to copy string into clipboard under all versions of 3D Max:
if( Copy_roll != undefined ) then -- recreate if window already existing
DestroyDialog Copy_roll
rollout Copy_roll "Copy test"
(
edittext copy_txt pos:[7,5] fieldWidth:220
button copy_btn "Copy to clipboard" width:220
on copy_btn pressed do
(
ShellLaunch ((GetDir #scripts)+"\\Copy_to_clipboard.exe") ("\"" + copy_txt.text + "\"")
)
)
CreateDialog Copy_roll width:240
As you can see it needs external aplication to working. Download and place it into scripts directory.
2 Replies
Jul 16, 2010 10:33 am
external applications are unnecessary, you can use the .NET Clipboard class to achieve the same thing and more:
Clipboard = dotnetclass "System.Windows.Forms.Clipboard"
Clipboard.SetText "some text"