Scripting GC - how to get from file name to window?
Posted: Thu Sep 02, 2021 11:03 am
Hi, I'm trying to write a (JavaScript) script to work with the currently selected files in GC. It's simple to get the current selection like so
Now, sel is an array ("list" in AppleScript parlance) containing the file names of the selected images. If I understand the GC script dictionary correctly, almost all methods and properties are bound to the Window object and not accessible if only a file name is available.
How would I go about to (for example) set the property "IPTC credit text" (bound to Window) if all I have is a file name? If somebody knows how to do that in AppleScript, that's fine too – I'll manage to translate that.
Code: Select all
var app = Application("GraphicConverter 11");
var sel = app.windows[0].selection()
How would I go about to (for example) set the property "IPTC credit text" (bound to Window) if all I have is a file name? If somebody knows how to do that in AppleScript, that's fine too – I'll manage to translate that.