does display.save not work in desktop ?

this code works in simulator but not macosx

display.save( pages[x], { filename=“page”…tostring(x)…".png", baseDir=system.DocumentsDirectory, captureOffscreenArea=false, backgroundColor={0,0,0,0} } )

roger

If if works in the simulator on the same machine, it should work in your OS X app on that machine.

  • which version of Corona
  • which version of OS X
  • What machine specifically?  MBP gen 1, 2, … you get the idea.

Hi Ed,

Corona Version 2018.3213 (2018.1.26)

Mac Version 10.13.3

MacBook Pro

Model Identifier: MacBookPro11,4

MBP114.0177.B00

it is the same computer…

just tried the example  from corona api docs…

it draws on screen but does not save as written.

That is very odd.  I wonder if there is a setting you need to set in the build.settings. file.

Also, are you absolutely sure you’re looking for the saved file in the right place?  It is easy to mistakenly look in the wrong folder.

I have looked and searched for the file… not sure about a setting I may be missing

Please Rob or anyone from Corona, Does Display.save() work in desktop or am i doing something wrong. I really need 

to be able to save to system.DocumentsDirectory.

this code works in simulator but not macosx

 

display.save( pages[x], { filename=“page”…tostring(x)…".png", baseDir=system.DocumentsDirectory, captureOffscreenArea=false, backgroundColor={0,0,0,0} } )

 

roger

Can you please put together a simple test project that demos the problem complete with build.settings and config.lua and put it in a .zip file and share the link here and I’ll give it a try. It needs to be able to be able to build and run and see the problem.

Now one thing I can think of is that saving photos on macOS can require some additional entitlements when saving files to particular folders. 

Rob

this is my test file…

it works in simulator as expected, on desktop it shows on screen but will not save. I have tried picture directory and Documents directory.

https://app.box.com/s/143aryt1ct7hxzwx9jq7hwyu65yr4yma

thanks in Advance

Roger

The .zip file seems to be corrupt.

Rob

try this…

https://app.box.com/s/x7s68hncbfnco2khxs25cg8qz62ombw3

It works for me.  The system.DocumentsDirectory for your app is 

~/Library/Application Support/holmesTest

The contents there include Application Support, Documents and tmp. Inside the Documents folder is a file named entireGroup.png and it contains the contents of the group.

Rob

bingo !  Thank you Rob !!!

is there a way to save to the Mac Documents dir directly ?

We had an engineer working with some people last year on figuring out how to write to public directories. I believe there are some entitlements that need to be added to the provisioning profile that you use to build the desktop app.  You can search the forums, or use Google to search them and see if you can find some of these previous posts.

I think this is the relevant thread:

https://forums.coronalabs.com/topic/66911-displaycapturescreen-not-saving-to-desktop-in-production-build/

Rob

Thank You…

If if works in the simulator on the same machine, it should work in your OS X app on that machine.

  • which version of Corona
  • which version of OS X
  • What machine specifically?  MBP gen 1, 2, … you get the idea.

Hi Ed,

Corona Version 2018.3213 (2018.1.26)

Mac Version 10.13.3

MacBook Pro

Model Identifier: MacBookPro11,4

MBP114.0177.B00

it is the same computer…

just tried the example  from corona api docs…

it draws on screen but does not save as written.

That is very odd.  I wonder if there is a setting you need to set in the build.settings. file.

Also, are you absolutely sure you’re looking for the saved file in the right place?  It is easy to mistakenly look in the wrong folder.

I have looked and searched for the file… not sure about a setting I may be missing

Please Rob or anyone from Corona, Does Display.save() work in desktop or am i doing something wrong. I really need 

to be able to save to system.DocumentsDirectory.

this code works in simulator but not macosx

 

display.save( pages[x], { filename=“page”…tostring(x)…".png", baseDir=system.DocumentsDirectory, captureOffscreenArea=false, backgroundColor={0,0,0,0} } )

 

roger

Can you please put together a simple test project that demos the problem complete with build.settings and config.lua and put it in a .zip file and share the link here and I’ll give it a try. It needs to be able to be able to build and run and see the problem.

Now one thing I can think of is that saving photos on macOS can require some additional entitlements when saving files to particular folders. 

Rob