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

  • SEARCH
  • Home
  • 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

Related Questions

I need to get current connection state. I found: System.Net.NetworkInformation.NetworkChange.NetworkAvailabilityChanged event but how can
Is there an iPhone SDK API that I can use to get the current
I'm working on a tool that needs to get the current user's wallpaper path.
How can I get current time (I need hours, minutes, seconds) crossplatform in c++?
I need to get current perl thread id in a C function inside *.XS
I understand I can get current directory by $CurrentDir = Dir.pwd How about parent
how can I get current time with library boost. I can do this: ptime
I can use Server[request_time] to get current timestamp. But how would I use this
How can you get current script directory in Perl? This has to work even
How can i get current MainNavigationMenu hyprelink in code behind and check if is

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.