\documentclass[11pt,a4paper]{book}
\usepackage{pgfkeys}
\usepackage{xstring}
\newcommand{\setIPA}[1]{\pgfkeyssetvalue{/IPA}{#1}}
\newcommand{\getIPA}{\pgfkeysvalueof{/IPA}}
\newcommand{\ScriptIPA}[1]{
\StrSubstitute{#1}{a}{A}
\setIPA{#1}
\setIPA{\StrSubstitute{\getIPA}{a}{A}}
\setIPA{\StrSubstitute{\getIPA}{e}{3}}
\setIPA{\StrSubstitute{\getIPA}{o}{8}}
\getIPA
}
\begin{document}
\ScriptIPA{ae}
\end{document}
This is a small macro I am working on, what I am trying to do is create somethign that can turn a string I have in normal text into textipa friendly symbols so it cna show IPA text, but when I try this it doesn't work out, I figure strsubstitute doesn't like functions within it's first arguement but how would I go about it?