Save pages doc to iCloud?

I am trying to get Applescript to save a Pages doc to iCloud. Stefan her suggested that that

~/Library/Mobile Documents/com~apple~Pages/Documents/

Would work, but when I try

set mobileFolder to “~/Library/Mobile Documents/com~apple~Pages/Documents/”

and then try to save the document with

save currentDocument in file mobileFolder

I get an error. Anyone have any thoughts>

You have to specify the full HFS path (colon separated) plus the file name

Thanks, I tried to do this but can;t seem to get it to work. This is what I tried:

To set the path variable:

set mobileFolder to path to “RK home imac:Macintosh HD:Users:[USERNAME]:Library:Mobile Documents:com~apple~Pages:Documents:”

To save:

save currentDocument in file (mobileFolder & fileName)

path to is a reserved expression and works only for predefined system paths


set mobileFolder to (path to library folder from user domain as text) & "Mobile Documents:com~apple~Pages:Documents:"

Thanks! Will give it a try!

In fact, you had an extraneous component in your path.

I can’t guess what was the source of “RK home imac:”

Yvan KOENIG (VALLAURIS, France) lundi 9 décembre 2013 18:11:41