Author Topic: Help with Max scripting  (Read 1186 times)

2023-10-12, 15:03:26

aaouviz

  • Active Users
  • **
  • Posts: 886
    • View Profile
    • Another Angle 3D
Man, I suck at maxscript...

I want to make a simple "Save and then Exit" script (via toolbar button).

This is what I have, but I can't quite get it to work as intended. Any helpers out there? Many thanks!

Code: [Select]
--Original script by: aaouviz
------

macroscript SaveAndExit
category: "AAScripts"
buttonText: "Save and Exit"
tooltip: "Save and Exit"
Icon:#("AAGen_01",1)


(
saveMaxFile
)
quitmax #noprompt
« Last Edit: 2023-10-12, 15:51:29 by maru »
Nicolas Pratt
Another Angle 3D
https://www.instagram.com/anotherangle3d/

2023-10-12, 15:32:07
Reply #1

James Vella

  • Active Users
  • **
  • Posts: 540
    • View Profile
I assume you just want File > Save correct? Overwrite previous version?

Code: [Select]
--Original script by: aaouviz
------

macroscript SaveAndExit
category: "AAScripts"
buttonText: "Save and Exit"
tooltip: "Save and Exit"
Icon:#("AAGen_01",1)
(
        max file save
quitmax #noprompt
)

2023-10-12, 20:39:34
Reply #2

aaouviz

  • Active Users
  • **
  • Posts: 886
    • View Profile
    • Another Angle 3D
Amazing, and perfect as always James.

Thanks a million!
Nicolas Pratt
Another Angle 3D
https://www.instagram.com/anotherangle3d/

2023-10-12, 21:47:25
Reply #3

James Vella

  • Active Users
  • **
  • Posts: 540
    • View Profile
Glad to hear its working as expected :)

2024-01-11, 09:17:53
Reply #4

Frood

  • Active Users
  • **
  • Posts: 1922
    • View Profile
    • Rakete GmbH
Hi,

picked up the idea but implemented it as file menu item. Additionally, saving only happens if a save is required (no changed made to scene, relying on getSaveRequired()). Script goes to any autostart folder (usually scripts\startup). Sharing it as an alternate option.


Good Luck



Never underestimate the power of a well placed level one spell.

2024-01-11, 10:48:00
Reply #5

aaouviz

  • Active Users
  • **
  • Posts: 886
    • View Profile
    • Another Angle 3D
Excellent!

The 'saving only happens if a save is required' seemed a bit beyond my capabilities, so I didn't bother. But this is clever of you, and I feel pleased to have I've influenced you, Frood :)
Nicolas Pratt
Another Angle 3D
https://www.instagram.com/anotherangle3d/

2024-01-11, 13:21:42
Reply #6

Frood

  • Active Users
  • **
  • Posts: 1922
    • View Profile
    • Rakete GmbH
Yes, thanks for letting me steal that idea to use them for myself - which is my daily deed ;)


Good Luck



Never underestimate the power of a well placed level one spell.