Created
December 28, 2008 15:43
-
-
Save sorbits/40983 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| tell application "NicePlayer" | |
| set movie_file to path of current movie in front playlist as alias | |
| tell application "Finder" | |
| set label index of movie_file to 6 | |
| -- display alert (name of first file in container of movie_file as Unicode text) | |
| set filelist to files in container of movie_file | |
| set all_watched to yes | |
| repeat with the_file in filelist | |
| if name extension of the_file is in {"avi", "mpg", "mp4", "wmv"} and label index of the_file is not equal to 6 then | |
| set all_watched to no | |
| end if | |
| end repeat | |
| if all_watched is equal to yes then set label index of container of movie_file to 6 | |
| -- set folder_name to name of container of movie_file as Unicode text | |
| -- set filename_length to length of (name of movie_file as Unicode text) | |
| -- set extension_length to ((length of (name extension of movie_file as Unicode text)) + 1) | |
| -- set filename to text 1 thru (filename_length - extension_length) of (name of movie_file as Unicode text) | |
| -- | |
| -- if folder_name is equal to filename then | |
| -- set label index of container of movie_file to 6 | |
| -- end if | |
| end tell | |
| if (count of windows) is 1 then | |
| quit | |
| else | |
| close window of current movie in front playlist | |
| end if | |
| end tell | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment