Jump to content

I want to create a workflow to pull up my current background photo in Finder.


Recommended Posts

OK, I've made some headway!

 

Make a new Workflow from Templates - Essentials - Keyword to script

Fill in the details however you want and click Create

Double click on the Keyword box

Use whatever keyword you want

In the dropdown, select No Argument

For now put "Reveal Desktop Wallpaper" in the Title Field

Click Save

Double click on the Run Script box

In the Language dropdown, select "/usr/bin/osascript"

In the Script area paste the following:

tell application "System Events"
set posix_path to (pictures folder of current desktop)
set picPath to (POSIX file posix_path) as string
end tell
tell application "System Events"
tell current desktop
  if picture rotation = 0 then
   tell application "System Events"
    set posix_path to (picture of current desktop)
    set thePicture to (POSIX file posix_path) as string
   end tell
   tell application "Finder"
    reveal thePicture
    activate
   end tell
  else
   set thePictures to (do shell script "sqlite3 ~/Library/Application\\ Support/Dock/desktoppicture.db \"SELECT * FROM data\" | sed -n '$p'")
   set fullPath to picPath as string
   set rotationImage to fullPath & thePictures
   tell application "Finder"
    reveal rotationImage
    activate
   end tell
  end if
end tell
end tell

Click Save

 

Now, when you type your keyword and hit ENTER a Finder window should pop up with the currently displayed wallpaper selected

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...