setting desktop picture from canvas? 
Author Message
 setting desktop picture from canvas?

Is there an _easy_ way to set the finder's desktop picture to a picture you
have in your rb project or does it have to have a physical jpeg (for
instance) picture on the harddrive to do it?

If that is the case, how do I go about "exporting" the picture from my
realbasic application onto the other people's machines and then set it as
desktop picture?

Thanks for your time..

/swimp



Wed, 04 Feb 2004 19:34:10 GMT  
 setting desktop picture from canvas?

Quote:

> Is there an _easy_ way to set the finder's desktop picture to a picture you
> have in your rb project or does it have to have a physical jpeg (for
> instance) picture on the harddrive to do it?

> If that is the case, how do I go about "exporting" the picture from my
> realbasic application onto the other people's machines and then set it as
> desktop picture?

> Thanks for your time..

> /swimp

Is that what you look for (It uses a file)?

dim ae as appleEvent
dim f as folderItem
dim p as picture
dim s as string

p=Canvas1.backdrop
f=volume(0).child("TempPict")
f.SaveAsPicture p
f=ControlPanelsFolder.child("Appaerence")
f.launch 'If that doesn't work, use appleEvent:
ae=NewAppleEvent("aevt","odoc","MACS"); ae.folderItemParam("----")=f; if not
ae.send then; end if
s=SetDesktopPict() 'An appleScript
ae=newAppleEvent("aevt","quit","apcp")
if not ae.send then
end if

The appleScript:

on run
 try
  tell application "Apparence" --This open the control panel, too...
   set picture file of monitor 1 to ((name of startup disk)&":TempPict" as
alias)
  end tell
 on error errtext
  return errtext
 end try
 return "OK"
end run



Thu, 05 Feb 2004 00:12:31 GMT  
 setting desktop picture from canvas?

01-08-18 18.12:

Quote:

>> Is there an _easy_ way to set the finder's desktop picture to a picture you
>> have in your rb project or does it have to have a physical jpeg (for
>> instance) picture on the harddrive to do it?

>> If that is the case, how do I go about "exporting" the picture from my
>> realbasic application onto the other people's machines and then set it as
>> desktop picture?

>> Thanks for your time..

>> /swimp

> Is that what you look for (It uses a file)?

How about I just bundle a jpeg picture in the same folder as my realbasic
application called desktoppicture.jpg

How would the applescript be programmed then, to just use the picture named
desktoppicture.jpg in the same folder and set it as the background pic?

//julius



Thu, 05 Feb 2004 22:08:19 GMT  
 setting desktop picture from canvas?
Julius wrote :

Quote:

> 01-08-18 18.12:


> >> Is there an _easy_ way to set the finder's desktop picture to a picture you
> >> have in your rb project or does it have to have a physical jpeg (for
> >> instance) picture on the harddrive to do it?

> >> If that is the case, how do I go about "exporting" the picture from my
> >> realbasic application onto the other people's machines and then set it as
> >> desktop picture?

> >> Thanks for your time..

> >> /swimp

> > Is that what you look for (It uses a file)?

> How about I just bundle a jpeg picture in the same folder as my realbasic
> application called desktoppicture.jpg

> How would the applescript be programmed then, to just use the picture named
> desktoppicture.jpg in the same folder and set it as the background pic?

> //julius

Add/modify this: (Does that works?)

f=GetFolderItem("").child("desktoppocture.jpg") 'This is the file
s=GetFileAP(f) 'Another method to convert the file into a string (See below)
s=SetDesktopPict(s) 'The script has now a parameter which is the
desktoppicture.jpg file

In the appleScript:

on run {TheFile}
 try
  tell application "Apparence"
  set picture file of monitor 1 to (TheFile as alias)
  end tell
 on error errtext
  return errtext
 end try
 return "OK"
end run

Function GetFileAP(f as folderItem)
'No comments...
dim g as folderItem
dim s as string

g=f
do
if s="" then
s=g.name
else
s=g.name+":"+s
end if
g=g.parent
if g=nil then
exit
end if
loop
if f.directory then
s=s+":"
end if
return s
end function



Thu, 05 Feb 2004 23:41:36 GMT  
 setting desktop picture from canvas?

Quote:

> Add/modify this: (Does that works?)

modify what!?

Quote:
> f=GetFolderItem("").child("desktoppocture.jpg") 'This is the file
> s=GetFileAP(f) 'Another method to convert the file into a string (See below)
> s=SetDesktopPict(s) 'The script has now a parameter which is the
> desktoppicture.jpg file

> In the appleScript:

> on run {TheFile}
> try
> tell application "Apparence"
> set picture file of monitor 1 to (TheFile as alias)
> end tell
> on error errtext
> return errtext
> end try
> return "OK"
> end run

> Function GetFileAP(f as folderItem)
> 'No comments...
> dim g as folderItem
> dim s as string

> g=f
> do
> if s="" then
> s=g.name
> else
> s=g.name+":"+s
> end if
> g=g.parent
> if g=nil then
> exit
> end if
> loop
> if f.directory then
> s=s+":"
> end if
> return s
> end function

You don't think Its possible for you to make the applescript and send it to
me, do you?? For some reason I can't use my script editor, it just keeps on
{*filter*} my computer..


Thu, 05 Feb 2004 23:51:57 GMT  
 setting desktop picture from canvas?

Quote:

> You don't think Its possible for you to make the applescript and send it to
> me, do you?? For some reason I can't use my script editor, it just keeps on
>{*filter*} my computer..

I already tried this, but your address is bad.


Sat, 07 Feb 2004 00:39:31 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Problems with picture (256 color) on desktop with colorsettings 256 colors

2. Desktop-Problems : Mousecoordinates within picture

3. Setting the wallpaper on a win2k desktop

4. Automating Desktop Settings in Warp

5. Setting OS/2's Desktop Background Color

6. desktop background settings

7. Setting Minimize To DESKTOP ??

8. Question about setting up objects on desktop

9. HELP! how do you set DESKTOP

10. Setting Folder Position and Size on Desktop

11. email server/desktop settings

12. SET-DESKTOP-WINDOW question

 

 
Powered by phpBB® Forum Software