Go Back   Cockos Incorporated Forums > REAPER Forums > Dstruct's Casa De Nitpicks

Reply
 
Thread Tools Display Modes
Old 03-30-2022, 08:47 AM   #1
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,630
Default Main_SaveProjectEx-function should return a "didn't save" hint

I just noticed, that the Main_SaveProjectEx-function shows an error-message, if a project couldn't be saved, but gives no note toward the scripter, that failing has saved.

This could be difficult, if I have a script, that stores the project and wants to do things with the rpp afterwards, cause: If the saving didn't work, then I shouldn't do the next steps.

If one would save using a filename, that doesn't exists, file_exists() could allow checking, if the file exists and if it doesn't I know something is wrong.
However, if the filename already exists, I can't check, that it wasn't stored.
(Unless I load the previous file as string, load the "after"-file as string, and compare them, but huge projectfiles make this extremly slow).

So, I would like to have a boolean retval in this function that returns, if saving the file was successful or an error occured, so I can react to it accordingly.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 03-30-2022, 09:57 PM   #2
_Stevie_
Human being with feelings
 
_Stevie_'s Avatar
 
Join Date: Oct 2017
Location: Black Forest
Posts: 5,067
Default

Yep, agreed, that would be really useful and important to have.
__________________
My Reascripts forum thread | My Reascripts on GitHub
If you like or use my scripts, please support the Ukraine: Ukraine Crisis Relief Fund | DirectRelief | Save The Children | Razom
_Stevie_ is online now   Reply With Quote
Old 03-31-2022, 09:46 AM   #3
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,630
Default

Also noticed, that the function sometimes creates the file under a temporary filename. In that case, it should return the alternative filename as well.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 07-04-2022, 08:21 AM   #4
MonkeyBars
Human being with feelings
 
MonkeyBars's Avatar
 
Join Date: Feb 2016
Location: Hollyweird
Posts: 2,637
Default

+1 Yes this would be useful.

It should be straightforward enough to add a return Boolean success/fail on both Main_SaveProject() and Main_SaveProjectEx().
MonkeyBars is online now   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 01:11 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.