Is it possible to run a shell command in ``Run javascript"
It seems to be possible to use the Zotero JavaScript API to get the file path of a Zotero attachement. But I'm wondering whether it is possible to run a shell script using that path. For example, using a system application to open the attachment, i.e.
'open -a /Applications/Preview.app ' + path
'open -a /Applications/Preview.app ' + path
(Best to post coding questions on zotero-dev. We try to keep technical discussions there.)
I'm new to javascript and Zotero. When I select an attachment in Zotero, open `Tools -> Developer -> Run Javascript` and copy the following code
```
var selectedItems = ZoteroPane.getSelectedItems();
var item = selectedItems[0];
var filePath = item.getFilePathAsync();
Zotero.Utilities.Internal.exec('/usr/bin/open', ['-a', "Preview", filePath]);
```
into the context box, then click Run, I only get the output of
```
{
"isFulfilled": false,
"isRejected": false
}
```
without Preview opening the file.
https://www.zotero.org/support/dev/client_coding/javascript_api#running_ad_hoc_javascript_in_zotero
```
var selectedItems = ZoteroPane.getSelectedItems();
var item = selectedItems[0];
var filePath = await item.getFilePathAsync();
await Zotero.Utilities.Internal.exec('/usr/bin/open', ['-a', "Preview", filePath]);
```
https://github.com/wshanks/Zutilo