Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- on findNextDesktopPicture(dektop_pictures_folder)
- tell application "Finder"
- set set_next to false
- repeat with each_file in folder dektop_pictures_folder
- if set_next is true then
- set desktop picture to each_file
- return
- end if
- if (each_file as POSIX file) is (desktop picture as POSIX file) then
- set set_next to true
- end if
- end repeat
- set desktop picture to first file of folder dektop_pictures_folder
- end tell
- end findNextDesktopPicture
- on changeDesktopPicture(dektop_pictures_folder)
- tell application "Finder"
- -- Pokud Finder nezná cestu k obrázku na ploše
- if desktop picture is missing value then
- set desktop picture to first file of folder dektop_pictures_folder
- else
- my findNextDesktopPicture(dektop_pictures_folder)
- end if
- end tell
- end changeDesktopPicture
- on run argv
- --display dialog first item of argv
- tell application "Finder"
- set dektop_pictures_folder to first item of argv as POSIX file
- -- Zkontrolovat, zda dodaná složka existuje
- if not (exists dektop_pictures_folder) then
- return
- end if
- -- Zkontrolovat, zda v zadané složce něco je
- if (count (every file in folder dektop_pictures_folder)) is less than 1 then
- return
- end if
- my changeDesktopPicture(dektop_pictures_folder)
- end tell
- end run
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement