Having an issue with a script after upgrade to Snow Leopard

I built a tool to look for printers on my corporate network by parsing in web site information then I would provide a list of printer drivers to choose from in order to utilize lpadmin in the script to install the printer on your system. After upgrade to Snow Leopard this part of the script now fails to provide a list of the files in the printer driver directory. Yes, the drivers are installed I can browse for them and find them.

The issue is where I call “get name of first disk” and prepend it to the path. It returns “Home” now instead of the system disk. I had done it this way in order to get the name of the primary drive as it will be different depending on the system it is installed on.

I was probably doing it wrong under Leopard with the follow script.


set FRED to get name of (items of folder ((get name of first disk) & “:Library:Printers:PPDs:Contents:Resources:en.lproj”))

repeat with i in FRED
if i begins with (first word of drvr_sort) and i contains (last word of drvr_sort) then
set end of BETTY to i
end if
end repeat

set PRNT_DRVR to (choose from list BETTY with prompt "Select Your Printer Driver: ") as string


How should I be doing this? If someone could narrow down the part of documentation I should be reading to learn this aspect I would greatly appreciate it.

Thanks,
Pete

Hi,

even in Leopard or earlier there is a better method to access the printer driver folder of the startup drive reliably


set FRED to paragraphs of (do shell script "/bin/ls /Library/Printers/PPDs/Contents/Resources/en.lproj")

Stefan,

Thanks. I knew there must have been a better way. Works wonderfully.

Thanks again,
Pete