Skip to content

Instantly share code, notes, and snippets.

@amonshiz
Created March 6, 2019 02:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amonshiz/0a49d84f17a476f3e3524cf1d62897fd to your computer and use it in GitHub Desktop.
Save amonshiz/0a49d84f17a476f3e3524cf1d62897fd to your computer and use it in GitHub Desktop.
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