import QtQuick 2.0 import MuseScore 1.0 MuseScore { menuPath: "Plugins.SetMetaTags" description: "Update metaTags using title, composer and lyricist" onRun: { if (!(curScore)) { Qt.quit() } else { var today = new Date() var revision = "①②③④⑤⑥⑦⑧⑨⑩⑪⑫" revision = revision.substr(today.getMonth(),1) revision = Qt.formatDateTime(today,"yyyy") + "µR" + revision + Qt.formatDateTime(today,"dd") curScore.setMetaTag("revision",revision) setMetaTagIfEmpty("copyright","Publisher catalog № © year by Publisher ℗ owner name") setMetaTagIfEmpty("composer",curScore.composer) setMetaTagIfEmpty("lyricist",curScore.poet) setMetaTagIfEmpty("workTitle",curScore.title+" — "+curScore.composer) setMetaTagIfEmpty("workTitle+",curScore.title) setMetaTagIfEmpty("movementTitle",curScore.title) setMetaTagIfEmpty("source+",curScore.metaTag("source")) setMetaTagIfEmpty("mixerType","") curScore.setMetaTag("movementTitle-"," — ") curScore.setMetaTag("composer-"," — ") } } function setMetaTagIfEmpty(metaTagName,metaTagValue) { if (curScore.metaTag(metaTagName) == "") { curScore.setMetaTag(metaTagName,metaTagValue) } } }