Hello,
I have been trying all sorts of workarounds for this problem at hand which is
I have a macmini used as an installation piece in a gallery.
this macmini is running a php webscript when the php script comes to an end the user has a printout from an attached printer
The problem is that I do not want the user to be able to edit the settings in the print confirmation window
I have been trying many different way to resolve this which include disabling the rights to edit print setting etc
Now I have it so when the final page loads of the php script webpage a javascript window calls the print function before this javascript is called I have
php create a txt file in a folder, what I would like to do is
Either have an applescript watch the system processes for when the print window opens (is called from safari) and then run the appelscript below
press print button
tell application "System Events"
tell process "Safari"
activate
set frontmost to true
delay 3
key code 36
end tell
end tell
Or call this applescript via osascript such as
<?php shell_exec("osascript -l open /Library/Webserver/Documents/pressprint.app'"); ?>or
<?php shell_exec("osascript -l open /Library/Webserver/Documents/pressprint.scpt'"); ?>The only problems is I cannot get osascript to work with this shell_exec I can get it t work from terminal but not from www user, I could run the www as root as this machine will never be n the net and also be in a small room, but then I reall do not know how to call osascript via php by root or do I just run webserver completely a root
Or final last hope to get this to work
would be have an open applescript running 24/7 checking for this txt file that php creates on page load, when it finds the file run pressprint.app and then delete file after running
but my applescripting is really no good just a noob
on idle
tell application "Finder"
if the (count of files) in folder watchFolder > 0 then
wait 1 sec
if the (count of files) in folder watchFolder > 1 then
tell application "System Events"
tell process "Safari"
activate
set frontmost to true
delay 3
key code 36
then delete file
end idle
But as you can see I could really need some help, thank you for taking the time to read my long winded problem
Sincerely
David
Model: Maacmin 1.44 PPC
AppleScript: 1.0
Browser: Safari 2.04
Operating System: Mac OS X (10.4)