Over a million developers have joined DZone.

Set Desktop Background Droplet

-- This script should be run as a droplet
-- It expects that an image is dropped on it's icon

-- The on run handler is called if the user has double clicked the icon
on run
	display dialog "Please drop an image file on this Icon to set it as the desktop background"
end run

-- The on open handler is called when the user drags and drops  afile on the icon
on open draggeditems
	set imageFile to last item of draggeditems
	tell application "Finder"
		select window of desktop
			set desktop picture to file (imageFile as text)
		on error
			display dialog "Invalid image file."
		end try
	end tell
end open


{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}