Forums
New posts
Articles
Product Reviews
Policies
FAQ
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Menu
Log in
Register
Install the app
Install
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
AppleScript Help Needed: Delete Watched TV Shows in iTunes
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="AustinMatherne" data-source="post: 1001717" data-attributes="member: 144351"><p>I've got the script below which seems to work perfectly, but I'm stuck on adding an error check so that if it doesn't find anything to delete it won't display an error. If anyone knows how to do this, I'd truly appreciate the help.</p><p></p><p>[CODE]tell application "iTunes"</p><p> set filesToDelete to location of (file tracks whose (video kind is TV show) and (unplayed is false))</p><p> delete (tracks whose (video kind is TV show) and (unplayed is false))</p><p> end tell</p><p> tell application "Finder"</p><p> repeat with theFile in filesToDelete</p><p> delete theFile</p><p> end repeat</p><p> end tell[/CODE]</p><p></p><p>Thanks,</p></blockquote><p></p>
[QUOTE="AustinMatherne, post: 1001717, member: 144351"] I've got the script below which seems to work perfectly, but I'm stuck on adding an error check so that if it doesn't find anything to delete it won't display an error. If anyone knows how to do this, I'd truly appreciate the help. [CODE]tell application "iTunes" set filesToDelete to location of (file tracks whose (video kind is TV show) and (unplayed is false)) delete (tracks whose (video kind is TV show) and (unplayed is false)) end tell tell application "Finder" repeat with theFile in filesToDelete delete theFile end repeat end tell[/CODE] Thanks, [/QUOTE]
Verification
Name this item. 🍎
Post reply
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
AppleScript Help Needed: Delete Watched TV Shows in iTunes
Top