MAS - Impossible to save ?

I am encountering a thorny issue with the MAS.

I wrap with App Wrapper, as usual, but the reviewers are simply not able to save…

I will appreciate any suggestion.


Guideline 2.1 - Performance

We discovered one or more bugs in your app when reviewed on Mac running macOS 10.15.3.

Specifically, upon review we have been unable to save content and will receive an error. (See screenshot and screen recording)

Screen shot
Screen movie

Hello,
do you check if the parent folder of the file you want to save (in this case „Desktop“) is writeable? If yes, you should not, because checking that property gives error messages in sandboxed apps.
Simply try to save the file and catch exceptions.

I just provide a save dialog, that’s it.

I’m curious about the fact that the error says “Desktop.”, with the period. That seems odd to me, is there a clue there?

I was surprised to see a Finder icon in the message; this let me think it is a message from the Finder, not the application.

Of course, I may be wrong.

Providing a save dialog is the correct thing to do.

Some things to consider.

  1. The file MUST use the name returned from the save dialog, at this point it doesn’t matter if it’s got the wrong extension or not. That’s all you’re allowed.
  2. Atomic saving CANNOT take place in that location (where you save out the file to a temporary file first, then replace the existing file).
  3. How are you saving the file? Which API?
  4. This could be a local permissions problem on the users machine.
  5. Can you reproduce the problem?
  6. If this were an entitlements issues, my previous experience suggests that the save dialog wouldn’t display. Perhaps that’s changed, in the Capabilities pane of App Wrapper, ensure that “Open/Save dialogs” is set to read/write.

I’ll second Gavin’s note about the path. I ran into a similar frustration and my parent had gotten a comma added to the end due to the manner in which I use a CSV in a listbox and was splitting on the “space” instead of “comma space”.

I was able to watch the movie - didn’t want to work on my “reading” machine.

Have you set the file type for the save dialog? I noticed that when it was first opened, it displayed .jpg. The reviewer deleted it all and then entered in his name? If you haven’t, by setting a file type on the save dialog, you ensure that the folderitem returned should have a file name extension.

Thank you for the suggestions.

What makes that strange is that the app has been in the MAS for years, and I did not change the way it saves pictures.

I suspect very strongly the reviewer has f*cked up settings on his machine.

I was never able to reproduce the issue under Catalina.

Sam: I notice that in App Wrapper, you have options for user’s download folder, Music, Movies, Pictures. I suppose this reflects as settings in info.plist or somewhere else. Would there be the equivalent for Documents and Desktop, now ?

Here is the code I use. LeBuffer is the picture I draw to:

dim f as folderitem if TargetWin32 then nomdefichier=nomdefichier+".bmp" f=GetsaveFolderItem("*.bmp",nomdefichier) else nomdefichier=nomdefichier+".jpg" f=GetsaveFolderItem("image/jpeg",nomdefichier) end if leBuffer.HorizontalResolution = 300 leBuffer.VerticalResolution = 300 if f<>Nil then lebuffer.Save(f, Picture.SaveAsJPEG) f.parent.Open sauvepic=sauvepic+1 'increment picture number end if

I frankly don’t see where or how I could authorize saving to Documents…

TargetWin32 — Xojo documentation is deprecated (but not removed)

GetSaveFolderItem — Xojo documentation is deprecated (but not removed)

Inconsistency: file type can be bmp, but you use jpg for all:

https://documentation.xojo.com/api/files/folderitem.html.Open
Is awaiting one or two Parameters, you provided none.

Since you cannot specify the default directory, it is choosen for you courtesy of macOS.
You meant Desktop (instead of Documents), isn’t it ?

Lockdown is boring.

Sorry Michel, I’ve made an error.

Your code on El Capitan / Sojo 2015r1 opend the Documents folder (here). Not related to Desktop.

And I forgot: I clicked in Cancel (of the dialog), and of course I get a crash in the first line that set the Picture resolution: it have to be located inside the last If block.

Maybe my fault as I declared the Picture:

Dim leBuffer As Picture

I confirm, this is my fault, I set an image to leBuffer and it no more crashed.

Emile, I am using 2019R3.1 and the app runs under Catalina. The Apple reviewer is also using Catalina, or perhaps Mojave, as demonstrated by the dark screen shots.

So you are calling (Desktop-FolderItem).Open.
And the reviewer gets the Error “No permission to open ‘Desktop’.” Kind of makes sense… :wink:

It would most likely work if you’re opening the created Picture-File, and not it’s parent Folder.
Or use a Declare to Show this file in Finder. Again: the File to which you have access by using the Save(As)-Dialog (and not it’s Parent!).

[code]#if TargetMacOS then
Declare Function NSClassFromString Lib “Cocoa” (className As CFStringRef) As Ptr
Declare Function sharedWorkspace Lib “AppKit” selector “sharedWorkspace” ( obj As Ptr ) As Ptr
Declare Function selectFile Lib “AppKit” selector “selectFile:inFileViewerRootedAtPath:” ( obj As Ptr, fPath As CFStringRef, rootFullPath As CFStringRef ) As Boolean

Dim ptrNSWorkspaceClass As Ptr = NSClassFromString(“NSWorkspace”)
Dim workspace As Ptr = sharedWorkspace(ptrNSWorkspaceClass)
call selectFile(workspace, aFolderItem.Nativepath, “” )
#endif[/code]

Thanks Jürg. But the issue is not the folder.Open per se. I should have removed that.

The reviewer gets stuck when trying to save, much before in the code, as shown by his movie.

[quote=482298:@Michel Bujardet]Here is the code I use. LeBuffer is the picture I draw to:

dim f as folderitem if TargetWin32 then nomdefichier=nomdefichier+".bmp" f=GetsaveFolderItem("*.bmp",nomdefichier) else nomdefichier=nomdefichier+".jpg" f=GetsaveFolderItem("image/jpeg",nomdefichier) end if leBuffer.HorizontalResolution = 300 leBuffer.VerticalResolution = 300 if f<>Nil then lebuffer.Save(f, Picture.SaveAsJPEG) f.parent.Open sauvepic=sauvepic+1 'increment picture number end if

I frankly don’t see where or how I could authorize saving to Documents…[/quote]

GetSaveFolderItem is deprecated. Perhaps it’s not using the catalina required api’s ?

Try it with:
https://documentation.xojo.com/api/files/folderitem.html.ShowSaveFileDialog
instead and send it in for review again.

I have replaced all the GetSaveFolderItem by FolderItem.ShowSaveFileDialog.

But I am still stuck, because it seems impossible to reproduce the issue.

Here, no matter what, under Catalina, it graciously saves to Desktop.

I am strongly suspecting the reviewer is an idiot who denied the app saving once, and now I am punished for his stupidity :confused:

[quote=482369:@Michel Bujardet]I have replaced all the GetSaveFolderItem by FolderItem.ShowSaveFileDialog.

But I am still stuck, because it seems impossible to reproduce the issue.

Here, no matter what, under Catalina, it graciously saves to Desktop.

I am strongly suspecting the reviewer is an idiot who denied the app saving once, and now I am punished for his stupidity :/[/quote]

Ok try it changing this:

lebuffer.Save(f, Picture.SaveAsJPEG)

To this:

lebuffer.Save(f, Picture.Formats.JPEG)

It’s want’s a enumeration, it maybe that xojo didn’t update the old functions somehow to be compatible with catalina since the folderitem changes. That may have something to do with this.

At last it seems really odd that it’s showing “Desktop.” (note the “.”) in the video. Somehow this reviewer has an odd desktop folder or there is a typo somewhere?

I was able to finally reproduce the issue!

I uploaded the zipped pkg to my server, then downloaded from the MacBook under Catalina. Installed, and now I get the dreaded The application “Barcode Wizard+” does not have permission to open “Desktop.”
With the dot after Desktop. And the same occurs with Documents, and Pictures.

I am surprised by Pictures, since I set read/write in App Writer for the Pictures folder.

So now I am still stuck, but at least I have seen it with my own eyes.

I frankly don’t know what to do at this point. The app does not even appear in the Security and Privacy Preferences Files and Folders area…

If I don’t find a way fast, I can say bye bye to MAS presence.

Michel, if you like, I can give it a quick run here on a number of clean macOS VMs (last 4 or 5 versions) and see if I get the error? That way, we could narrow it down to a Catalina issue. Not sure if it’s helpful, but the offer is there.