Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 82197
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T21:34:45+00:00 2026-05-10T21:34:45+00:00

How do I get the current wallpaper on a Mac? Just point me to

  • 0

How do I get the current wallpaper on a Mac? Just point me to an API function so I can Google more.

Edit: I think I found it. [NSUserDefaults standardUserDefaults] mentioned at http://lists.apple.com/archives/student-dev/2004/Aug/msg00140.html

Also possible from shell: defaults read com.apple.desktop Background

And from AppleScript: http://discussions.apple.com/thread.jspa?messageID=7111272

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T21:34:46+00:00Added an answer on May 10, 2026 at 9:34 pm

    Updated Answer (Mavericks and newer)

    Starting with Mavericks, Apple writes the Desktop images to

    /Users/<current-user>/Application Support/Dock/desktoppicture.db  

    which is an SQLite database. You can open this file in Terminal like this

    sqlite3 '/Application Support/Dock/desktoppicture.db' 

    and then run the following SELECT:

    SELECT display_uuid,space_uuid,value  FROM preferences  JOIN data ON preferences.data_id=data.ROWID  JOIN pictures ON preferences.picture_id=pictures.ROWID JOIN displays ON pictures.display_id=displays.ROWID  JOIN spaces ON pictures.space_id=spaces.ROWID ; 

    The output will be

    <UID1>|<UID2>|<PicturePath> <UID1>|<UID2>|<PicturePath> : 

    UID1 is the UID of a display (e.g. the display of your MacBook, an external display, etc. as every display can have an own background image), UID2 is optional (sometimes it is missing, which probably means all spaces of that display) and it is the UID of a space (every display on OS X can have multiple spaces and every space can have an own background iamge) and <PicturePath> is the path to the picture (for this specific space on this specific display).

    Of course you can link your App against the SQLite library and do all that with library calls, but how to use SQLite and the SQL syntax for queries and updating data are, of course, way beyond the scope of this answer. Just one tip: You exit the sqlite client by typing .exit (note the leading period!) and hit enter (CTRL+C will not work).

    Just one more note: You can update the database in your app, but that will have no effect as the Dock will not know about it (you change it behind its back). To make the Dock aware of that change, you have kill it like killall Dock, it may be enough to just HUP it (killall -HUP Dock), which will not really kill it (I have not tested that). Within an app, you’d have to find the process ID of the Dock and send it a signal (this is the same that killall does), getting process IDs and sending signals is also beyond the scope of that reply.

    Legacy Answer (Lion and earlier)

    You are on the right track. If you write an application in Carbon/Cocoa, just load the preference file. It is located in

    /Users/<current-user>/Library/Preferences/com.apple.desktop.plist 

    The dictionary contains a sub-dictionary with the key default and this sub dictionary contains a key ImageFilePath, containing the absolute path to the image file.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 61k
  • Answers 62k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer Here's the answer, with example code, direct from the source… May 11, 2026 at 9:57 am
  • added an answer If you are on Windows, you can open the source… May 11, 2026 at 9:57 am
  • added an answer As far as I know, the ScriptService attribute just allows… May 11, 2026 at 9:57 am

Related Questions

How do I get the current wallpaper on a Mac? Just point me to
How do I get the current size of a matrix stack (GL_MODELVIEW, GL_PROJECTION, GL_TEXTURE)
How do I get the current time in Python?
How do I get the key of the current element in a foreach loop
How do I get the history of commits that have been made to the
How do I get the id of my Java process? I know there are
How do I get the caller's IP address in a WebMethod? [WebMethod] public void
How do I get the modified date/time of a file in Python?
How do I get the ASCII value of a character as an int in
How do I get the list of open file handles by process id in

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.