I discovered what I was doing wrong. Doh!
In FM Adv, Insert File returns file:<nameOfFile> as the first line, but in a Runtime Insert File returns a whole path & filename.
This is the code I came up with to get around the problem in the Runtime
# Get the file of interest
Insert File [ Books::gFilePathContainer ] [ Reference ]
# Get the file path & file name
# Get the full file path from the second line in Books::gFilePathContainer & remove the leading filemac:/
Set Variable [ $filePath; Value:Substitute ( GetValue ( Books::gFilePathContainer ; 2 ) ; "filemac:/" ; "" )]
# Find the last "/" in the file path so we can then extract the file name from the end of the file path
Set Variable [ $lastPos; Value:Position ( $filePath ; "/" ; Length ( $filePath ) -1; -1 ) ]
# Get the name of the file from the end of the file path
Set Variable [ $fileName; Value:Middle ( $filepath ; $lastPos + 1 ; 64000 )]
# Remove the file name from the end of the file path
Set Variable [ $filePath; Value:Left ( $filepath; $lastPos )]