Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- tell application "iTunes"
- set sel to selection of front browser window
- if sel is {} then
- try
- display dialog "Nothing is selected…" buttons {"Quit"} with icon 0
- end try
- return
- end if
- set c to (count of sel)
- set songName to (get name of item 1 of sel)
- set userOptions to display dialog "Edit for Work name and then click OK." default answer songName --prompt for work name
- repeat with i from 1 to c --set the movement numbers
- set thisTrack to item i of sel
- try
- set work of thisTrack to text returned of userOptions
- set movement number of thisTrack to i
- set movement count of thisTrack to c
- set movement of thisTrack to my delRomNum(name of thisTrack) -- copy movement text from song name and delete roman numerals
- end try
- end repeat
- end tell
- on delRomNum(t) -- the perl command search and delete any roman numeral (must be a word followed by the period and a space character)
- do shell script "/usr/bin/perl -pe 's/\\b[IVXLCDM]+\\b. //g' <<< " & quoted form of t
- end delRomNum
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement