Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Apple Script- Possible?

Apple Script- Possible?
Thread Tools
Professional Poster
Join Date: Apr 2000
Location: Berkshire, UK
Status: Offline
Reply With Quote
Sep 9, 2004, 01:26 PM
 
I have a project I would like to do, and was wondering if it was even possible before I spent too much time on it.

I have an OSX box connected to a Cinema display in the lobby of our building acting as a welcome sign. We change this based on events, visitors etc. The process has been- create a Powerpoint presentation, load it on the Mac, and run it. What I would like is:

1. Receptionist creates presentation.
2. Connects to mac via web (she, and almost everyone else, is on windows)
2. She uploads the presentation to a folder.
3. Clicks a link that runs a script on the mac to launch the presentation and display it on the monitor.

Is this possible? Can you activate a script via a web link?

Thanks.
Paco is bitter about the loss of his .mac webpage. Image will return when his sadness lessens.
     
Junior Member
Join Date: Mar 2000
Location: Salem, OR, USA
Status: Offline
Reply With Quote
Sep 9, 2004, 07:38 PM
 
Originally posted by Paco500:
I have a project I would like to do, and was wondering if it was even possible before I spent too much time on it.

I have an OSX box connected to a Cinema display in the lobby of our building acting as a welcome sign. We change this based on events, visitors etc. The process has been- create a Powerpoint presentation, load it on the Mac, and run it. What I would like is:

1. Receptionist creates presentation.
2. Connects to mac via web (she, and almost everyone else, is on windows)
2. She uploads the presentation to a folder.
3. Clicks a link that runs a script on the mac to launch the presentation and display it on the monitor.

Is this possible? Can you activate a script via a web link?

Thanks.
Don't know about the web link thing, but you could write an applescript that would watch for a new .ppt file showing up in a particular directory and then run it. You could set the script to check and then go to sleep for one minute or two or five or whatever you wanted.
     
Professional Poster
Join Date: Nov 2000
Location: Tasmania, Australia
Status: Offline
Reply With Quote
Sep 9, 2004, 07:47 PM
 
It's entirely possible to create a web link that initiates a script that will do what you want. Make a perl script, or shell script that runs as a WWW CGI script, and it can utilise the osascript command to run an applescript (or there's even an AppleScript module for Perl for running apple script commands directly within perl).

However, as the previous post said, it's probably unecessary. Simply create a folder action script that runs whenever something is added to the folder. This would be easier, eh?
     
Professional Poster
Join Date: Oct 2001
Location: London
Status: Offline
Reply With Quote
Sep 10, 2004, 06:29 AM
 
[php]
-- make this script a a Folder Action for added files
on adding folder items to watchFolder after receiving newItems
showPresentation(newItems)
end adding folder items to


-- Routine that shows a powerpoint presentation
to showPresentation(newItems)
-- display dialog "folder script starts" buttons {"OK"} default button 1
tell application "Finder"
repeat with thisFile in newItems
if kind of thisFile is "Microsoft PowerPoint document" then
tell application "Microsoft PowerPoint"
activate

if start up dialog then
set start up dialog to false
end if

close active presentation
close every window

open thisFile
set these_settings to the slide show settings of the front presentation
run slide show these_settings
end tell
end if
end repeat
end tell
end showPresentation

[/php]

{edit: added code to close start up dialog }
{edit2: added code to close any active presentations before showing new one.}


•Copy the code above and paste into script editor.
•Save it to the presentation machine at the path: /Library/Scripts/Folder Action Scripts/ (creating any folders as necessary)
•Make a new folder on the presentation machine (e.g. ~/presentations/)
•Right-click the new folder in the finder and choose "Configure Folder Actions")
•In the window that pops up make sure that the "Enable Folder Actions" checkbox is ticked.
•Press the Plus button at the bottom of the window - choose the Presentations Folder - then choose the script from the sheet.

You should then be able to upload presentations to ftp://presentationMachineRendezvousN...Presentations/ and they should (cross fingers) auto present.

If you've applied the recent OS X security update then uploaders will require an SFTP client.
(Last edited by Diggory Laycock; Sep 11, 2004 at 02:01 PM. )
You know it makes sense. ☼ ☼ ☼ Growl.
     
Junior Member
Join Date: Mar 2000
Location: Salem, OR, USA
Status: Offline
Reply With Quote
Sep 10, 2004, 10:33 AM
 
Great script!

I kind of got the impression that some slide show is always running and that the new one should replace the old. If this is the case then there has to be something in there that checks and closes any running show, maybe deletes the old file (so you don't get a pile of them) and then opens and runs the new one.

Just my thought on what he needs.

Nice organization on the script though.

Doug
     
Paco500  (op)
Professional Poster
Join Date: Apr 2000
Location: Berkshire, UK
Status: Offline
Reply With Quote
Sep 10, 2004, 02:30 PM
 
Wow- way more held than I had anticipated or hoped for- thanks for all the help.

Can't wait to get in into action.
Paco is bitter about the loss of his .mac webpage. Image will return when his sadness lessens.
     
Professional Poster
Join Date: Oct 2001
Location: London
Status: Offline
Reply With Quote
Sep 11, 2004, 02:01 PM
 
Edited code to close any old presentations.
You know it makes sense. ☼ ☼ ☼ Growl.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 01:13 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2