PDA

View Full Version : AppleScript "choose file" Keeps Remembering Last Visited




Caleb531
Nov 11, 2009, 07:52 PM
Today, I encountered a bug in AppleScript. Below is a script I use to choose a wallpaper from my Wallpaper folder and set it as my wallpaper. I have another script like this for uninstalling apps, which sets the 'choose file' in my Applications folder. When I run that script and then this one, the location is not in my Wallpaper folder like it should.

Long story short, when I use 'choose file' in the Script Editor, the Finder dialog does not go to the folder I specified, but to the last folder I visited there. is there any way I might fix this?

try
tell application "Finder"
set myWallpaper to choose file of folder "Macintosh HD:Users:Squiddy22:Pictures:Wallpaper:"
set desktop picture to myWallpaper
end tell
end try



kainjow
Nov 11, 2009, 10:58 PM
Try this line instead:
set myWallpaper to choose file default location alias "Macintosh HD:Users:Squiddy22:Pictures:Wallpaper:"

Caleb531
Nov 12, 2009, 09:51 AM
Thanks so much! That solved all my problems.