Quantcast
Channel: Adobe Community: Message List - Photoshop Scripting
Viewing all articles
Browse latest Browse all 27456

Re: How to attach a UI dialog to a script?

$
0
0

And you can save the data by putting it to an action descriptor and saving to custom options. I have assumption about JSON encoding, but many other ways of stuffing things to action descriptors are possible.

 

savePreferences: function (metadata) {  var metadata_json = serialize_to_json(metadata)  var desc = new ActionDescriptor()  desc.putData(0, metadata_json)  app.putCustomOptions (APP_ID, desc, true)
},
loadPreferences: function () {  try {  var desc = app.getCustomOptions (APP_ID)  if (desc) {  var metadata_json = desc.getData(0)  if (metadata_json) {  eval("var result = (" + metadata_json + ")")  if (result) {  return result  }  }  }  } catch (e) {  var foo = e.message  }
},

Viewing all articles
Browse latest Browse all 27456

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>