Dear readers,
Before I ask your help with my problem, I would like to introduce myself ever so shortly:
My name is Dennis, a 40 year old Apple Service Engineer from the northern part of the Netherlands.
I have been working with Apple’s for over 15 years now and repairing them for over 8 now.
My expertise in repairs is much much better than my expertise in scripting.
This is why I would like to ask this great community for some help!
The problem is as follows:
For an educational partner I am looking to find a way to add printers to the printerlist without overwriting the excisting printerlist.
This is much more of a challenge than I anticipated.
I tried using Pakcagemaker to make a package of the printers that need to be added in order for the users to easily upgrade their excisting printer list with new printers bought by the organization.
The problem with this is the fact that the package made by packagemaker will overwrite the excisting list.
After some hard thinking I found a solution (in my head at least).
What if I could copy the contents of the /private/etc/cups/ppd folder to a temporary folder on the desktop, then execute the package made with packagemaker and then copy the contents of the temporary folder back to the /private/etc/cups/ppd folder without overwriting it’s current contents.
That would probably solve my problem as the overwriting from the package made with Packagemaker would be negated by making a copy of the excisting folder nd then copying the contents of said folder back to the system folder.
I found out you can add applescript tp your packagemaker package, so it would be fantastic if I could come up with a script that would do the following things for me:
- Create a temporary folder on the desktop called “CUPS_TEMP”
- Copy the contents of the /private/etc/cups/ppd folder to the CUPS_TEMP folder on the desktop
- Wait for the execution of the packagemaker folder (I can set priorities in packagemaker to solve sequence problems)
- After the execution and adding of the new printers copy the contents of the CUPS_TEMP folder back to the /private/etc/cups/ppd folder and adding the contents to that folder without overwriting the contents of that folder.
- Delete the CUPS_TEMP folder after all actions have been completed
Sadly, my knowledge and Google haven’t brought me past the creation of a folder on my desktop with the name CUPS_TEMP using the following script:
tell application "Finder"
set p to path to desktop
make new folder at p with properties {name:"CUPS_TEMP"}
end tell
I would REALLY appreciate any help you could give me regarding this problem.
Thank you in advance for reading and any help you can give me!
Kind regards,
Dennis