0

I'm trying to get the bounds of the desktop using the following code:

tell application "Finder"
    get bounds of window of desktop
end tell

I keep getting the following error:

error "Finder got an error: Can’t get bounds of window of desktop." number -1728 from bounds of window of desktop

I found that the same question has been asked --> get bounds of desktop with applescript but the solution over there (something about turning on this preference: defaults write com.apple.finder CreateDesktop -bool false) didn't work for me when I tried it. I'm using High Sierra, while that solution was given back in 2012.

Any ideas what else I could try to get the bounds of the actual screen, not my Desktop directory?

Thanks

yehoshuk
  • 35
  • 1
  • 7
  • Explicitly close the AppleScript document and Script Editor. Reboot and then open Script Editor and in a new document run this command, as is,: `tell application "Finder" to get bounds of window of desktop` Do you still get an error? If yes, then on the same computer but different account, even if you have to temporarily create one, run the same command. Does it still error out? What version of of macOS are you running? – user3439894 Apr 13 '18 at 17:33
  • This worked - thanks! – yehoshuk Apr 16 '18 at 15:47

0 Answers0