ZBrushCentral

How can I save file without dialog?

Everytime I try to overwrite file it shows annoying menu to confirm.
I wrote script that allows me to skip this menu and overwrite file but when I import file in project script doesn’t working and overwrite another file.

[IButton,???,“Save File”,
[IShowActions,0]
[IConfig,2022]
[IFreeze,
[VarDef,lastUsedFileName,[FileNameGetLastTyped]]
[FileNameSetNext,lastUsedFileName][IPress,File:Save As]
[VarSet,lastUsedFileName,[FileNameGetLastUsed]]
]
,1/4,]

I @Noobowski and welcome on ZBC!
I have to move the thread to the right place in Zscripting forum.

I don’t think it’s necessary to use the [VarDef,lastUsedFileName,[FileNameGetLastTyped]]

[IButton,???,“Save File”,
[IShowActions,0]
[IConfig,2022]
[IFreeze,

[FileNameSetNext, "c:/my_project.zpr"]
[IPress,File:Save As]

]//end IFreeze
]

Hope this Help,
Nicolas

Your scrpit always save at one place with same name. But I want to overwrite my current project. Like in other software you press ctrl+s and overwrite current file.

It can’t to work as [FileNameGetLastTyped] will change if you save to anything else than a ZPR file.
The best you can do is to create 2 Macros, one to Load ZProject, and one for Save ZPR
Load script will store the filepath on the disk and load the ZPR file
When you press Save ZPR, it gonna access that variable on the disk and use this path for saving.
But as you don’t reset the value stored it will work from a session to another ZBrush session, but if you start to work on another ZPR file, it could overwrite the project that is store into the variable, so you got to find a way to reset the value. If you always use the custom load ZProject if should maintain the right path and prevent from overwriting the previous project.
Hoper it helps,
Nicolas

Ok thanks. It’s weird that there is no that feature by default