Desktop Hintergrund über Skript Droplet ändern

Na ja… so kann man (wenn nötig) eben recht komfortabel und schnell den Bildschirmhintergrund über ein Droplet im Dock ändern… wer es braucht:

[download#19#image]

und der Code

on open these

if (count of these) = 1 then

set display_IDs to get_display_id()

repeat with display_ID in display_IDs

if folder_check(these) = true then

do_folder(these, display_ID)

else

do_file(these, display_ID)

end if

end repeat

else

error “entweder ein Bild oder einen Ordner mit Bilder auf das Skript ziehen!”

end if

end open

on do_folder(these, display_ID)

tell application “Finder” to set these to these as alias

set thelist to {“Nach definierter Zeit”, “Nach Login”, “Nach Aufwachen”}

tell me to activate

set pic_roation to choose from list thelist with prompt “Wann sollen die Bilder gewechselt werden?” default items item 1 of thelist

if pic_roation as text = (item 1 of thelist) as text then

set pic_rotation to 1

else if pic_roation as text = (item 2 of thelist) as text then

set pic_rotation to 2

else

set pic_rotation to 3

end if

if pic_rotation = 1 then

set dialog_zusatz to “”

repeat until 1 = 2

set pic_interval to text returned of (display dialog “Nach wieviel Sekund soll das Bild geändert werden?” & dialog_zusatz default answer “5”)

try

set pic_interval to pic_interval as real

exit repeat

on error

set dialog_zusatz to return & return & pic_interval & ” ist ist doch kein Zahl!”

end try

end repeat

end if

set thelist to {“Durcheinander”, “Der Reihe nach”}

tell me to activate

set pic_order to choose from list thelist with prompt “Die Reihenfolge?” default items item 1 of thelist

if pic_order as text = (item 1 of thelist) as text then

set pic_order to true

else

set pic_order to false

end if

tell application “System Events”

tell desktop display_ID

try

set pictures folder to these

set picture rotation to pic_rotation

set change interval to pic_interval

set random order to pic_order

end try

end tell

end tell

end do_folder

on do_file(these, display_ID)

tell application “Finder” to set these to these as alias

tell application “System Events”

tell desktop display_ID

try

set picture to these

set picture rotation to 0

on error msg

error msg

end try

end tell

end tell

end do_file

on get_display_id()

tell application “System Events”

set desktop_count to (count of every desktop)

end tell

if desktop_count > 1 then

set display_ID to {}

set thelist to {}

repeat with i from 1 to desktop_count

tell application “System Events” to set thelist to thelist & {i & “:” & (display name of desktop i) as text}

end repeat

tell me to activate

set ids to choose from list thelist with prompt “Desktop Hintergrund auf welchem Display ändern?” default items item 1 of thelist with multiple selections allowed

repeat with id in ids

set display_ID to display_ID & ((character 1 of (id as text)) as integer)

end repeat

else

return {display_ID}

end if

return display_ID

end get_display_id

on folder_check(these)

tell application “Finder”

set folderkind to kind of folder 1 of startup disk

if kind of item 1 of these = folderkind then

return true

else

return false

end if

end tell

end folder_check