Syntax Error: Type 10

Hello,

I’m a little new to applescript and created a script that uses System Events to UI Script adding a printer in Tiger using the Printer Setup Utility. The script ran fine until we tried to add the script to a package installer. We used osascript to run the script. After the installer runs a type 10 error has occurred error shows up in system.log and from that point on any scripts referencing Printer Setup Utility will not compile or run and give a windows labeled “Syntax Error” with the message “An error of type 10 occured”.

I get this error even with the most basic script:

tell application "Printer Setup Utility" activate end tell
Here is the original script we made that worked until we tried to invoke it using osascript:

[code]do shell script “touch /private/var/db/.AccessibilityAPIEnabled”
try
do shell script “lpadmin -x Adobe_PDF_9_0”
do shell script “lpadmin -x AdobePDF9”
do shell script “lpadmin -x Adobe_PDF_8_0”
do shell script “lpadmin -x AdobePDF8”
do shell script “lpadmin -x AdobePDF7”
tell application “Printer Setup Utility”
quit
delay 2
end tell
end try

tell application “Printer Setup Utility”
activate
tell application “System Events”
tell process “Printer Setup Utility”
click button 2 of tool bar 1 of window 1
click button 1 of tool bar 1 of window 1
delay 2
select row 1 of table 1 of scroll area 1 of group 1 of group 2 of group 1 of window 1
click button 5 of window 1
end tell
end tell
quit
end tell[/code]