-
1. Re: How to attach a UI dialog to a script?
c.pfaffenbichler Oct 14, 2014 12:43 AM (in response to ojodegato)Instead of entering the path manually would a folder selection dialog not be more convenient?
var theFolder = Folder.selectDialog ("select folder");
if (theFolder) {
var theFiles = theFolder.getFiles(/\.(jpg|tif|eps|psd)$/i)
};
-
2. Re: How to attach a UI dialog to a script?
Matias Kiviniemi Oct 14, 2014 1:48 AM (in response to ojodegato)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 } }, -
3. Re: How to attach a UI dialog to a script?
ojodegato Oct 18, 2014 8:29 PM (in response to c.pfaffenbichler)I try the Folder dialog but the Bridge script does not complete when using this option.
I would like to save the new tiff file in the same directory with the stack images.
Is there a way to omit the save location path to save the tiff in the same directory as the Bridge stack images?
var stackFileName = app.activeDocument.name;
var saveFile = new File('~/desktop/pscc test/'+stackFileName+' ');
app.activeDocument.saveAs(saveFile, tifOpts, true);
app.activeDocument.close(SaveOptions.DONOTSAVECHANGES);
-
4. Re: How to attach a UI dialog to a script?
c.pfaffenbichler Oct 19, 2014 2:51 AM (in response to ojodegato)There is a Bridge Scripting Forum, too, maybe you should post there.


