title: Why does my desktop background does not change after executing Python script?
body: <p>I followed <a href="https://youtu.be/VLNcnROUTb8?t=376" rel="nofollow noreferrer">this</a> tutorial for changing the background on my macOS Monterey 12.5. When I run the Python script my background ist not changing but I also don't get an error message.</p>
  <p>In <code>System Preferences &gt; Security &amp; Privacy &gt; Automation</code> I added the terminal in which I execute the script for being able to access <code>Finder</code>.</p>
  <p><strong>Code to change background:</strong></p>
  <pre class="lang-py prettyprint-override"><code>cmd = &quot;osascript -e 'tell application \&quot;Finder\&quot; to set desktop picture to POSIX file \&quot;&quot; + filename + &quot;\&quot;'&quot;
  os.system(cmd)
  </code></pre>