请告诉我如何以编程方式更改Mac OS X中的桌面背景? 我找到了,但对于Windows https://stackoverflow.com/a/12212368/2838676
答案 0 :(得分: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);
}
积分