Created
March 6, 2019 02:50
-
-
Save amonshiz/0a49d84f17a476f3e3524cf1d62897fd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let setTimeout = function(callback, duration) { | |
callback(); | |
}; | |
let req = new Request("https://cdnjs.cloudflare.com/ajax/libs/jsmediatags/3.9.0/jsmediatags.js"); | |
let content = await req.loadString(); | |
eval(content); | |
var fileURLs | |
if (args.fileURLs.length > 0) { | |
fileURLs = args.fileURLs | |
} else { | |
fileURLs = await DocumentPicker.open() | |
} | |
let fm = FileManager.local() | |
let filePath = fileURLs[0] | |
console.log(filePath) | |
let exists = fm.fileExists(filePath) | |
console.log(exists); | |
let d = fm.read(filePath); | |
jsmediatags.read(d.getBytes(),{ | |
onSuccess: function(tag) { | |
Pasteboard.copyString(tag["tags"]["comment"]["text"]) | |
}, | |
onError: function(error) { | |
console.log(error); | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment