Folder Actions with PowerPoint Slide Shows

Discussion in 'Mac Programming' started by kharkaar, Jun 21, 2011.

  1. kharkaar, Jun 21, 2011
    Last edited by a moderator: Jun 21, 2011

    macrumors newbie

    Joined:
    Jun 21, 2011
    #1
    Hi everyone, this is my first post and I need help with the following:

    I'm trying to set up a folder action script to a specific folder so whenever a file with".ppsx" or ".pps" extension is added to this folder, I want it to automatically open.

    This is what I have done so far and it works to an extend:

    Code:
    [COLOR="Blue"]on adding folder items to this_folder after receiving added_items
    try 
    repeat with this_item in added_items
    tell application "Finder"
    if name extension of this_item is "ppsx" or "pps" then
    open this_item
    end if
    end tell
    end repeat
    end try
    end adding folder items to[/COLOR]
    It does open the slide show and it runs perfectly BUT THE PROBLEM is when I add a new file to this folder, it doesn't refresh. It keeps the older slide show active.

    I wouldn't mind if the older file is deleted upon adding the new one. But I don't know how. Please help.
     
  2. Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #2
    You could possibly just quit PowerPoint so that when it opens the other one it's starting fresh. Try putting this before the "open" command.

    Code:
    [b]tell[/b] [i][color=#0000ff]application[/color][/i] "Microsoft PowerPoint" [b]to[/b] [b][color=#0000ff]quit[/color][/b]
     
  3. kharkaar, Jun 21, 2011
    Last edited: Jun 21, 2011

    thread starter macrumors newbie

    Joined:
    Jun 21, 2011
    #3
    Thanks for the reply. I did that but still opens up the old file. Any ideas?

    It actually closes the application but opens it with the old file and when I press escape then it closes the old file and opens the new one.
     

Share This Page