please tell me how to programmatically change the desktop background in Mac OS X? I found, but for windows https://stackoverflow.com/a/12212368/2838676
Asked
Active
Viewed 887 times
0
-
1Have a look at [this](http://stackoverflow.com/questions/19779980/is-it-possible-to-change-the-desktop-background-with-java-for-different-operatin) or [this](http://stackoverflow.com/questions/6199907/change-desktop-background-of-mac-sytem-using-java-native-access) – James Barnett Nov 25 '13 at 21:08
1 Answers
1
public void setWallpaper(File file)
throws Exception {
String as[] = {
"osascript",
"-e", "tell application \"Finder\"",
"-e", "set desktop picture to POSIX file \"" + file.getAbsolutePath() + "\"",
"-e", "end tell"
};
Runtime runtime = Runtime.getRuntime();
Process process;
process = runtime.exec(as);
}
Credits

Community
- 1
- 1

user1401250
- 336
- 2
- 7