FAQFAQ   SearchSearch   UsergroupsUsergroups   RegisterRegister   ProfileProfile    Log inLog in   RSS Feed

Delete Song File in iTunes

 
Post new topic   Reply to topic    Salling Software Forums Forum Index -> Scripting Salling Clicker for Mac
View previous topic :: View next topic  
Author Message
danielfo
Newbie


Joined: 01 May 2007
Posts: 9
Location: Bavaria

PostPosted: Tue May 01, 2007 12:59 pm    Post subject: Delete Song File in iTunes Reply with quote

Here is my way to completely delete songs in itunes.

the function:
[code:1]
on delete_current_track(flag)
if flag is 1 then
tell application "iTunes"
set atrack to current track
set alocation to POSIX path of (get location of atrack)
next track
try
delete atrack
on error
delete (first track of library playlist 1 whose database ID is (get database ID of atrack))
end try
do shell script "rm '" & alocation & "'"
end tell
end if
end delete_current_track
[/code:1]

how to run the function:
[code:1]
...
else if keyCode is ("0" as Unicode text) then
tell application "iTunes"
if duration of current track is not missing value then
tell application "SEC Helper"
enter boolean popup mode question "Delete Track?" affirmative response "delete_current_track"
end tell
end if
end tell
end if
[/code:1]

have fun!

Daniel
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Salling Software Forums Forum Index -> Scripting Salling Clicker for Mac All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group