I am trying to make a script to replace the currency in a book of 50 documents.
For example, I want to find “€” and replace it wit “£”, and also I want to find “Euro” and replace is with “GBP”.
This is what I’ve got, but I am doing something wrong with deli metering the text items, I think.
tell application "Adobe InDesign CS5"
activate
set ASTID to AppleScript's text item delimiters -- Store settings
set ChangeCurrencyArray to {"€/Euro", "£/GBP", "$/USD", "KÄ/CZK"}
set CurrencyID to (choose from list ChangeCurrencyArray with prompt "Selecteer de huidige munteenheid." OK button name "OK" without multiple selections allowed) as string
set ChangeToCurrencyArray to {"€/Euro", "£/GBP", "$/USD", "KÄ/CZK"}
set ToCurrencyID to (choose from list ChangeToCurrencyArray with prompt "Selecteer de gewenste munteenheid." OK button name "Update book" without multiple selections allowed) as string
if CurrencyID is false then return
set AppleScript's text item delimiters to "/" -- Everything splits at this character
set CurrencyBits to text items of CurrencyID as string
repeat with i from 1 to count CurrencyBits
set Currency to item i of CurrencyBits
if ToCurrencyID is false then return
set AppleScript's text item delimiters to "/" -- Everything splits at this character
set ToCurrencyBits to text items of CurrencyID as string
repeat with j from 1 to count ToCurrencyBits
set ToCurrency to item j of ToCurrencyBits
set find text preferences to nothing
set change text preferences to nothing
set find what of find text preferences to Currency
set change to of change text preferences to ToCurrency
set myFoundItems to change text
end repeat
end repeat
end tell