Hello, community.
I am running the following code inside an Execute a JavaScript For Automation
action, and I don't get any output. The following function lists the contents of a given directory.
(() => {
const main = () => {
return getDirectoryContents("~/Dropbox/Reference/Quiver.qvlibrary")
}
// getDirectoryContents :: FilePath -> IO [FilePath]
const getDirectoryContents = fp =>
ObjC.deepUnwrap(
$.NSFileManager.defaultManager
.contentsOfDirectoryAtPathError(
$(fp)
.stringByStandardizingPath, null
)
);
return main()
})();
However, when I paste the code in VSC I can successfully execute it. Does someone or perhaps @peternlewis know whether we can read files or folders saved in Dropbox with KM JXA action ?
P.D.: I am able to read other files and folders (not saved in the Dropbox folder).
I am running macOS ventura with a Mac book air m1.