March 19, 20205 yr Hi, Piecing bits from other posts I've cobbled something that looks promising: ------------ tell application "Microsoft PowerPoint" activate repeat with slideNumber from 1 to count of slides of active presentation tell slide slideNumber of active presentation repeat with shapeNumber from 1 to count of shapes set shapeText to content of text range of text frame of shape shapeNumber set selFind to get find object of selection clear formatting selFind set highlight to false set forward to true set format to true set newText to my replaceText(shapeText, findText, replaceText) if newText ≠shapeText then set content of text range of text frame of shape shapeNumber to newText end if end repeat end tell end repeat end tell on replaceText(theText as text, findString as text, replaceString as text) set {oTIDs, AppleScript's text item delimiters} to {AppleScript's text item delimiters, findString} set textItems to text items of theText set AppleScript's text item delimiters to replaceString set theResult to textItems as text set AppleScript's text item delimiters to oTIDs return theResult end replaceText ----------- The script order is probably off and certainly some lines are unnecessary. Anyone care to pitch in? All the very best, Daniel
March 19, 20205 yr Author I have two fields in FileMaker, one with the find text and the other with the replace text, plus some formatting conditions (highlight, forward, format). Filemaker contains a database with the find-replace pairs. So, instead of performing find-replace within Powerpoint by hand, I run the replacements from Filemaker.
March 19, 20205 yr I don't see any interaction with Filemaker in your script. Is that your question? How to pass data from Filemaker to the AppleScript?
March 19, 20205 yr Author The Filemaker file has two fields, one for 'find' and one for 'replace with'. I have a button which calls the script that should recognize that a powerpoint file is open and perform replacements within the entire file. I made one for replacing text within Word documents but it doesn't work the same because of the shapeName and shapeText variables.
March 19, 20205 yr Author Filemaker should interact with PowerPoint via an Applescript, invoked on Button click. The script should select each record within Filemaker and perform a find-replace until all the records have been processed.
Create an account or sign in to comment