Change Desktop Background
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Change Desktop Background
I asked this question on another category but no one ever answered. Maybe I'll have more luck here. Is there a way to change my computer's desktop background image from LiveCode? I can probably write a Python script to do this pretty easily, but I'd like to actually use LiveCode instead of having to use Python every time run into a dead end like this.
Re: Change Desktop Background
Hi,
Probably, you don't get any answers because you provide too little information. I think it is possible on Mac and Windows, but it'll require an additional scripting tool such as.... Python
Kind regards,
Mark
Probably, you don't get any answers because you provide too little information. I think it is possible on Mac and Windows, but it'll require an additional scripting tool such as.... Python

Kind regards,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Re: Change Desktop Background
LiveCode doesn't have any control outside of its own app space, but it can communicate in a couple of OS languages. If you want to change the desktop pattern on a Mac, you could look into using AppleScript. LiveCode can run AppleScripts using the "do as AppleScript" command. On Windows, there may be a shell command that will do it. For that, you'd use the "shell" function.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: Change Desktop Background
Jacque,
Since OP says he has a Python script, I'd recommend compiling that Pything script and running it from the shell or with a launch command.
Kind regards,
Mark
Since OP says he has a Python script, I'd recommend compiling that Pything script and running it from the shell or with a launch command.
Kind regards,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Re: Change Desktop Background
Hi sanoski,
you can use an AppleScript on OS X:
Put this into a field or custom property, replace the filename with the one you need and:
...
put fld "applescript" into AScript
do AScript as applescript
...
No idea about Windows
Best
Klaus
you can use an AppleScript on OS X:
Code: Select all
tell application "Finder"
set desktop picture to POSIX file "/your/filename.jpg"
end tell
...
put fld "applescript" into AScript
do AScript as applescript
...
No idea about Windows

Best
Klaus
Re: Change Desktop Background
Thanks for your help, everyone. I plan on using this for my Mac, but it might be a good idea to use a strategy for Windows too. I'm intimately familiar with Python. I know I can get that to work the way I want regardless if it's for Mac or Windows. LiveCode makes it easy to work with external resources, so I'm thinking Python is the best bet here. Thanks again. As long as we're talking Python, I got it handled.