You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

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

AppleScript+Pages: Export command always fails with permission error

Here is my script:


tell application "Pages"


set thisDoc to open "/Users/fmillion/test.pages"

set docFile to file of thisDoc

log "The file is " & docFile


export thisDoc to "/Users/fmillion/test2.docx" as Microsoft Word


end tell

The script runs, Pages opens and loads the document. However, the Export step fails. Here's the full events output:


tell application "Pages"


open "/Users/fmillion/test.pages"


--> document "test.pages"


get file of document "test.pages"


--> file "Macintosh HD:Users:fmillion:test.pages"


(*The file is Macintosh HD:Users:fmillion:test.pages*)


export document "test.pages" to "Macintosh HD:Users:fmillion:test2.docx" as Microsoft Word


--> error "The document “test.pages” could not be exported as “test2”. You don’t have permission." number 6

Result:

error "Pages got an error: The document “test.pages” could not be exported as “test”. You don’t have permission." number 6


No amount of fiddling with parameters will change this. Obviously, I have write permission to my home directory, which just to be absolutely sure I verified. (I do.) I even tried creating a directory with chmod 777 to give it world-writable state, but Pages still wouldn't export there.


I feel like I'm missing something - could anyone tell me what it is?


Thanks!


F

OS X Mavericks (10.9.2)

Posted on Apr 19, 2014 10:16 AM

Reply
33 replies

AppleScript+Pages: Export command always fails with permission error

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