Can AS alter the Panther sidebar?

I’m working on an iPhoto script that uses GUI scripting to do an import . The ability to import a specific folder or file–as demonstrated by Sal’s example script–doesn’t work in Panther because the “Go To” field for a POSIX Path is no longer in the import dialog.

However, I was pleased to find that I can import an entire disk by using GUI scripting to click on a sidebar icon in the dialog. I was even more pleased to find that “every disk whose ejectable is true” is now fixed in the Finder.

But as for importing a specific folder…is there someway we can add folders to the Panther sidebar via AS? I’m not seeing any support for it in the Finder dictionary, or any place that these items are exposed in the Finder as was the case with the Favorites directory.

Possibly this is something that could be set in a preference file somewhere?

Ray Robertson

This should get you started:

This reads the ~/Preferences/com.apple.sidebarlists.plist file. You can also use defaults to write prefs.

Jon


[This script was automatically tagged for color coded syntax by Script to Markup Code]

Jon,

Belated thanks for the shell script. It is indeed exactly what I need to get going.

Ray

There’s an example of this page to show how to import into iPhoto in Panther using GUI:

http://www.apple.com/applescript/uiscripting/03.html

Or click the following link to open it in the Script Editor:

iPhoto import script

Thanks, Sal. I see you are way ahead of the game on updating the sample scripts (shame on me for missing that).

I had also missed that control-/ will bring up a sheet with the go to field for a posix path. Although it is an extra step, I think it was a good move by Apple to take this confusing field out of the standard UI, but still make it available for the keyboard-friendly (and GUI scripting).

Ray