Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Applescript and Numbers saving/exporting issue after updating to OS Sierra 10.12.2

Hi, I made an applescript that generates a new numbers file from scratch, saves it in .numbers format and then exports it to pdf on a separate folder. It worked flawlessly on OS Sierra 10.12.1, but after updating on dec 27 2016 to 10.12.2 it gives the following error:


The document “Untitled” could not be saved as “my_custom_file_name.numbers”. You don’t have permission.

To view or change permissions, select the item in the Finder and choose File > Get Info.


When I removed the .numbers format saving part of the script to just leave the pdf export section, there is no error (no file being saved as .numbers triggering it of course) but there is also no pdf being exported and does not show any error for that one)


This is the portion of the script that I use for the saving/export for your reference:

...

set the defaultDestinationFolder to (path to me) as string

set documentName to "my_custom_file_name"


set exportFileName to documentName & ".numbers" as string

set the targetFileHFSPath to (defaultDestinationFolder & "Numbers versions folder:" as string) & exportFileName

save front document in file targetFileHFSPath


set exportFileName to documentName & ".pdf" as string

set the targetFileHFSPath to (defaultDestinationFolder & "PDF versions folder:" as string) & exportFileName

export front document to file targetFileHFSPath as PDF

...


I think this is an issue of OS Sierra 10.12.2 as it worked well before it.


The numbers version is 4.0.5 (4052)


Any ideas for a work around, and how to report this to apple so they can fix it on a future release? (I already tried going to http://bugreport.apple.com/ but for some reason it does not recognize my apple ID...)


Thanks for your help in advance.

MacBook Pro with Retina display, macOS Sierra (10.12.2), Numbers v4.0.5 (4052)

Posted on Jan 9, 2017 5:18 PM

Reply
Question marked as Best reply

Posted on Feb 2, 2017 3:06 PM

Fix found! for anyone having this same issue, just add this before the save or export line:


close access (open for accessexportDocumentFile)

Thanks to bjh333 for pointing it out on another post.

And thanks to Yvan Koenig for figure it out (source): http://macscripter.net/viewtopic.php?pid=188721

10 replies

There are no replies.

Applescript and Numbers saving/exporting issue after updating to OS Sierra 10.12.2

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.