Re: How can I set a background image to a Volume ?
Re: How can I set a background image to a Volume ?
- Subject: Re: How can I set a background image to a Volume ?
- From: Luther Fuller <email@hidden>
- Date: Wed, 21 Dec 2005 16:27:46 -0600
Emile Schwarz asked ...
I do not know if this is possible to do that with AppleScript, but it is
possible to do it (how ?).
I wrote something earlier this year that will do what you need. You
can download it at
http://scriptbuilders.net/files/setbackgroundpict1.0.html
I know, these files are invisible and (Mac OS X 10.3.9) AppleScript can only
read the .visible property, thus the question.
A large search on Apple Web site, a search in the Nov Doc .dmg does
not lead to
light - but I want to see the light ! -
Here's a copy of the main handler. I know there's an error in it, but
it always works properly on the second try, so I haven't tried very
hard to find it. The Finder CAN handle invisible items, but you must
create an alias from a posix path to make it work.
on setBackgroundPict(pictFile)
tell application "Finder"
name extension of pictFile
if the result is not in {"tif", "tiff", "gif", "jpg", "png",
"pdf"} then return
--
set folderRef to (container of pictFile) as alias
try
visible of window of folderRef
if (index of window of folderRef) > 1 then return
set current view of (window of folderRef) to icon view
on error errText number errNr
return
end try
--
try
make new folder at folderRef with properties {name:"hiddenpict"}
set hFolder to the result as alias
tell application "System Events" to set visible of hFolder to false
close window of folderRef
on error -- hidden folder already exists
my cleanHiddenFolder(folderRef, false)
(POSIX path of folderRef) & "hiddenpict" as POSIX file --
because folder is invisible
set hFolder to the result as alias
end try
--
try
move pictFile to hFolder
set background picture of icon view options of (window of
folderRef) to the result
on error errText number errNr
"Error = " & errNr & return & errText
display dialog the result --*******************
end try
--
open window of folderRef
end tell
end setBackgroundPict ---------------------------
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden