I’m trying to build a VERY simple piece of applescript that uses osasubr (macos X unix program → http://www.turbozen.com/mac/osasubr/) that passes two agruements (a *.URL file and the string printer name safari should print to). All of this done in the background hidden from the user without interfering (closing) any other open safari windows running on OS 10.3 or higher.
After trying to teach myself some applescript to do it, it just doesn’t seem to work at all
Any help/ideas/code?
Thanks
Mike
This is what I have so far:
on print {URL, printer1}
tell application "System Events" to set web_running to exists process "Safari"
tell application "Safari"
tell application "System Events" to if not web_running then set visible of process "Safari" to false
set target printer to printer1
print URL with properties print settings target printer
if not web_running then quit
end tell
end printer