Desktop Hintergrund über Skript Droplet ändern

18/01/2009

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 Desktop Picture Skripter Version 1.0

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

No Comments

iTunes Wiedergabe nach einiger Zeit automatisch stoppen

8/02/2008
itunes stop iconIch schlafe gerne mit Musik ein und dafür habe ich mir mal diese Anwendung geschrieben. Ist ein simples Skript, das wahrscheinlich auch Einzug in die iTunes-Skript-Sammlung erhalten wird. Dies aber schon vorab.Alles was man machen muss, ist das Skript starten, angeben, wie lange die Musik noch laufen muss... Nun, es erklärt sich wirklich von alleine =)Ach so, und Leopard-kompatibel ist es sogar auch schon ;-)
2 Comments

Emailbenachrichtigung bei 10.5.2-Update zum selbermachen

31/01/2008
update_message.pngIch warte mit dem Umstieg auf 10.5 bis das 10.5.2 Update durch ist, nur wann kommt es?Nun etwas umständlich, aber  prompt kommt die Nachricht auf mein Handy =)Dieses AppleScript lasse ich alle 15min laufen, sobald auf der Support-Seite von Apple die Rede von 10.5.2 ist, verschickt es eine Email.
Sobald eine Email mit diesem speziellen Betreff bei mir eintrifft, erhalte ich auch gleich noch eine SMS über meinen Email-Provider.Das Skript zum Automatischen Update habe ich mir dann aber doch noch verkniffen =)
 
set h to (word 1 of (do shell script "curl -s http://www.apple.com/support/downloads/ | grep 10.5.2 |/usr/bin/wc -l")) as integer
if h > 0 then
	tell application "Mail"
		close every window
		set newMessage to make new outgoing message with properties {subject:"10.5.2 Ist da!" as text}
		tell newMessage
			set visible to true

			make new to recipient at beginning of to recipients ¬
				with properties {address:"meineEmail@mac.com"}
		end tell
		send newMessage
	end tell
end if
3 Comments