Skip to content

Instantly share code, notes, and snippets.

@simonster
Created January 8, 2012 18:45
Show Gist options
  • Save simonster/1579282 to your computer and use it in GitHub Desktop.
Save simonster/1579282 to your computer and use it in GitHub Desktop.
Making a new custom document property
// PY-APPSCRIPT
self.asApp.make(new=k.custom_document_property, at=self.asDoc, with_properties={k.name:docPropertyName, k.value:docPropertyValue})
// SCRIPTING BRIDGE
NSAppleEventDescriptor *rd = [NSAppleEventDescriptor recordDescriptor];
[rd setDescriptor:[NSAppleEventDescriptor descriptorWithString:currentPropertyName] forKeyword:'pnam'];
[rd setDescriptor:[NSAppleEventDescriptor descriptorWithString:currentPropertyValue] forKeyword:'DPVu'];
[doc->sbApp sendEvent:'core' id:'crel' parameters:'kocl', @"mCDP", 'insh', doc->sbDoc, 'prdt', rd];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment