请告诉我如何以编程方式更改 Mac OS X 中的桌面背景? 我找到了,但是对于Windows https://stackoverflow.com/a/12212368/2838676
最佳答案
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);
}
致谢
关于java - 更改桌面背景 mac os x,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20203095/