Where are custom iWork templates stored in the latest version of iWork

#1

Dear Automators,

does anyone know where custom templates are stored in the latest version of iWork?

One feature of the most recent releases of iWork (e.g. Numbers version 6.0) is syncing of custom templates across devices with iCloud. This seems to have involved a change to the directory in which custom templates are stored.

It used to be that custom Numbers templates were stored, for instance, in ~/Library/Containers/com.apple.iWork.Numbers/Data/Library/Application Support/User Templates/, and Pages templates would be saved in an equivalent directory. But no more. My existing custom templates can still be found there, but adding templates to that location does not make the templates available to the app or show up in the template chooser.

Incidentally the other change appears to be with the template id for AppleScript. In AppleScript you can identify a template by name or id. The id used to be the path of the template file, or related to it at least. It’s now just a long string of apparently random letters and numbers like with document ids. This broke some of my scripts.

The reason I’m asking for the directory is that it’s key to some of my AppleScript-based workflows. I have scripts and applets that create documents for me and my team based on templates. The script first checks to see if the template already exists in the app (Numbers/Pages). If it does, then a new document is created from that template. If not, then the script first copies the template from somewhere else (e.g. the applet’s resources directory or a shared Dropbox folder) to the iWork custom templates folder, and then it can create the new document from the template. Once the new document is opened I can then easily replace the placeholder text with custom info.

That workflow no longer works in Numbers version 6.0. I can still see my existing custom templates in that directory but adding new templates to it doesn’t make them available to AppleScript or show up in the template chooser. I suspect there’s now a new location where the canonical versions of the templates are stored; somewhere that can be synced with iCloud. I just don’t know where.

Thanks a bunch for any help you can offer.

1 Like