ApfelSoftware.de
Mac Software
Code4Free
iTunes Sortieren iTunes Zähler iTunes Cover iTunes Titel Mac aus


 
iTunes Sortieren    Apple Script
In iTunes it is not possible to sort music with several criteria.

This Script creates from the selection a new, sorted playlist
named 'Sortiert'.

The script sorts in such a way:
1st: artist
2nd: album
3rd: title name

If many titles are selected, the script will work some
minutes. Only titles from the first library are processed
(generally you have only one). If titles of another library or
source (e.g. iPod) are selected, it can lead to the fact that a false
title is processed!

The sort sequence can be modified simply in the script. Just change in the 'hier' marked lines the code words. Example:

You want to sort fist by counter and not by artist:
In lines

set Interpret1 to artist of (item i of Liste) --hier (artist)
set Interpret to artist of (item j of Liste) --hier (artist)

replace 'artist' with 'played count'

set Interpret1 to played count of (item i of Liste) --hier (artist)
set Interpret to played count of (item j of Liste) --hier (artist)

To find more code words select in Script Editors File Menu 'Open Dictionary...' and then select iTunes. Select iTunes Suite/classes/track to find a list of code words for this script.

The idea to this script came by a posting in the Macblogg.de Forum (german)
Code:

 tell application "iTunes"
     set Bibliothek to 1st library playlist
     set np to make new playlist
     set dername to "Sortiert"
     set name of np to dername
     set Liste to {}
     set dbid to database ID of selection
     repeat with kopie in dbid
         set titel to (1st track of Bibliothek whose database ID is kopie)
         set the end of Liste to titel
     end repeat
     repeat with i from 1 to count of Liste   
         repeat with j from i + 1 to count of Liste
             set Interpret1 to artist of (item i of Liste) --hier (artist)
             set Interpret to artist of (item j of Liste) --hier (artist)
             if Interpret1 > Interpret then
                 set zwi to item i of Liste
                 set item i of Liste to item j of Liste
                 set item j of Liste to zwi
             else if Interpret1 = Interpret then
                 set Platte1 to album of (item i of Liste) --hier (album)
                 set platte to album of (item j of Liste) --hier (album)
                 if Platte1 > platte then
                     set zwi to item i of Liste
                     set item i of Liste to item j of Liste
                     set item j of Liste to zwi
                 else if Platte1 = platte then
                     set Titel1 to name of (item i of Liste) --hier (name)
                     set titel to name of (item j of Liste) --hier (name)
                     if Titel1 > titel then
                         set zwi to item i of Liste
                         set item i of Liste to item j of Liste
                         set item j of Liste to zwi
                     end if
                 end if
             end if
         end repeat
     end repeat
     repeat with i from 1 to count of Liste
         set titel to item i of Liste
         duplicate (item i of Liste) to np
     end repeat
 end tell
open in script editor

4,4kb Download
iTunes Zähler    AppleScript
Modify the counter of your iTunes Songs

This Script will change the play count of the selected iTunes Song.
Put the Script into Library/iTunes/Scripts in your Home-Directory to start it from iTunes script menu.

Select one song and start the script. Enter the new play count and click OK.

Code:

tell application "iTunes"
    display dialog "Neuer Zähler" default answer ""
    if button returned of result = "OK" then
        set a to text returned of result as integer
        set played count of selection to a 
    end if
end tell
open in script editor

1,6KB Download
 
iTunes Cover    AppleScript
Delete the artwork of iTunes songs

Put the Script into Library/iTunes/Scripts in your Home-Directory to start it from iTunes script menu.

To delete the artwork of your songs, select one ore more songs and start the script. If a song has more than one artwork only one will be deletet!

If many songs are selected, the script will work some minutes.
The script only deletes artwork from the first library (generally you have only one). If titles of another library or source (e.g. iPod) are selected, it can lead to the fact that a false title is processed!

To process the titles of another source complete the line
set Bibliothek to 1st library playlist with of source "MyLibrary". In place of MyLibrary enter the in iTunes shown name.
Example:
set Bibliothek to 1st library playlist of source "my iPod"

The idea to this script came by a posting in the Macblogg.de Forum (german)
Code:

tell application "iTunes"
    display dialog "Die Cover der ausgewählten Titel löschen?"
    if button returned of result = "OK" then
        set Bibliothek to 1st library playlist
        set dbid to database ID of selection
        repeat with loesch in dbid
            delete artworks of (1st track of Bibliothek whose database ID is loesch)
        end repeat
    end if
end tell
open in script editor

1,8KB Download
 
iTunes Titel    AppleScript
Delete in the playlist selected titles from the library and move to the trash.

Put the Script into Library/iTunes/Scripts in your Home-Directory to start it from iTunes script menu.

To delete songs, select one ore more songs and start the script. The song files will be moved to the trash.

If many songs are selected, the script will work some minutes.
The script only deletes songs from the first library (generally you have only one). If titles of another library or source (e.g. iPod) are selected, it can lead to the fact that a false title is processed!


To process the titles of another source complete the line set Bibliothek to 1st library playlist with of source "MyLibrary". In place of MyLibrary enter the in iTunes shown name.
Example:
set Bibliothek to 1st library playlist of source "my iPod"
If necessary remove the Code move Datei to the trash!
Code:

tell application "iTunes"
    display dialog "Auswahl wirklich aus der Bibliothek löschen?"
    if button returned of result = "OK" then
        set Bibliothek to 1st library playlist
        set dbid to database ID of selection
        repeat with loesch in dbid
            tell loesch
                set tit to (1st track of Bibliothek whose database ID is loesch)
                tell tit
                    set Datei to location
                    delete
                    tell application "Finder"
                        move Datei to the trash
                    end tell
                end tell
            end tell
        end repeat
    end if
end tell
open in script editor

2,3KB
Download
 
Mac aus    AppleScript
Shut down your Mac by Applescript.

After the
script start the normal shut down process will be initiated.
As usual the turn-off process can be interrupted by unsaved documents.

Use example:
Switch
off your Mac from the distance, by linking the Freeware AnrufAktion with Mac aus.
Code:

tell application "Finder" to shut down the (system attribute)
open in script editor

1,2KB
Download


Diese Seite ist in den folgenden Sprachen verfügbar:
This page is available in the following languages:

Deutsch
English

Do you want to add another or correct an language? Please send me a mail