通过applescript获取indesign文本框的内容

通过applescript获取indesign文本框的内容,applescript,adobe-indesign,Applescript,Adobe Indesign,我正在尝试形成一个applescript,它将在indesign中读取一个文本框的内容,如果该框包含字符“/”,则它将移动另一个文本框。我找到了如何移动另一个文本框的方法,但我无法找到让applescript“读取”第一个文本框中的内容并搜索字符的方法。这是我到目前为止所拥有的 tell application "Adobe InDesign CS6" tell active document set horizontal measurement units of vi

我正在尝试形成一个applescript,它将在indesign中读取一个文本框的内容,如果该框包含字符“/”,则它将移动另一个文本框。我找到了如何移动另一个文本框的方法,但我无法找到让applescript“读取”第一个文本框中的内容并搜索字符的方法。这是我到目前为止所拥有的

tell application "Adobe InDesign CS6"
    tell active document

        set horizontal measurement units of view preferences to inches
        set vertical measurement units of view preferences to inches
        repeat with x from 1 to count pages
            set ThisPage to page x

            tell ThisPage
                if (get text frames whose name of applied object style is "Box1") contains character "/" then
                    move (get text frames whose name of applied object style is "Box2") by {-1.245, 0} --relative move x, y 
                end if
            end tell
        end repeat
    end tell
end tell
我要么没有错误,但它不会做任何事情,要么它给我编译器错误。请帮忙!谢谢大家!

在“如果”测试中试试这个

如果存在(其(应用对象样式的名称为“Box1”且内容包含“/”)的文本框)

请在“如果”测试中尝试此方法

如果存在(其(应用对象样式的名称为“Box1”,内容包含“/”)的文本框)