PowerPoint sandboxing and placing images from Finder

I need some help working through a sandboxing problem which is preventing PowerPoint from accessing files in the Finder. I think this is all related to this tidbit from AppleScript’s release notes:

Well, Powerpoint uses the File Name property for the file path, and that property is, yup, a string. Because of this, when I pass my file path from the Finder, I get prompted to give PowerPoint access to the file in question. As I have some 400 files I’m working with, this is a no-go. Here’s a shortened version of the script that’s not working for me:

tell application "Finder" to get file "Macintosh HD:Users:nftbockhorst:Desktop:file1.gif" as string

tell application "Microsoft PowerPoint" to make new picture at end of slide 1 of active presentation with properties {file name:result}

Oddly enough, the code works if I just put a string directly into the command, which makes me think there may be hope:

tell application "Microsoft PowerPoint" to make new picture at end of slide 1 of active presentation with properties {file name:"Macintosh HD:Users:nftbockhorst:Desktop:file1.gif"}

Any ideas on how I can work through this? Thanks in advance!

Maybe PowerPoint is unable to work with the variable result.
Try :

tell application "Finder" to get file "Macintosh HD:Users:nftbockhorst:Desktop:file1.gif" as string
set theFile to result
tell application "Microsoft PowerPoint" to make new picture at end of slide 1 of active presentation with properties {file name:theFile}

Yvan KOENIG (VALLAURIS, France) mardi 3 novembre 2015 13:02:53