We will run through all the files and use the extension of the file to determine what actions we want to take:
Get Files to %Files%
Loop 0 to %Files.Count - 1%
Set %Files[LoopIndex].Extension% to %Ext%
Switch (based on) %Ext% 'If you don't know what Switch is, it is like having multiple if's and choosing a destination based on a variable. In this case, we will set up 3 procedures, 1 for each type of extension.
Case %Ext% = xlsx
'next you put in the steps to manage replace functionality in Excel
Launch Excel opening %Files[LoopIndex]%
Send Keys {Control}(f) 'Opens the find and replace
Send Keys {Alt}(p) 'Moves over to the replace tab
'now loop through all your replacement words
Launch Excel 'opening the replace file
Read Data from Excel to %ExcelData%
Loop 0 to %ExcelData.RowsCount - 1%
Send Keys {Alt}(n) 'Select the "Find What" text field
Send Keys %ExcelData[LoopIndex][0]% 'Format should be %Datatable[Row#][Column#] starting with 0s
Send Keys {Alt}(e) 'Select the "Replace with" text field
Send Keys %ExcelData[LoopIndex][1]%
Send Keys {Alt}(a) 'Replace All
End (Loop) 'Should loop through every replace text listed on your replace file
Save and Close Excel (or Save As if you want to save it somewhere else)
Case %Ext% = .docx
'I gave you Excel, you will have to figure the other two out on your own, just follow the same logic, the hotkeys will probably just be different is all
Case %Ext% = .pdf
'I gave you Excel, you will have to figure the other two out on your own, just follow the same logic, the hotkeys will probably just be different is all
End (Loop)
Best of luck!