shell命令复制文本似乎工作但格式没有返回到Applefile文件制作者

时间:2016-05-10 10:29:05

标签: shell applescript filemaker

我有一个AppleScript将一批rtf文件复制到一个文件制作者数据库,该数据库似乎运行良好,但文本进入filemaker字段而没有返回但看起来格式正确,例如 文字开头为 弗雷德琼斯 1山 伦敦 并且结尾看起来完全一样,但是当我在文本上使用filemaker搜索脚本进行返回时,它找不到任何内容 我需要从rtf到txt的转换,否则会在字段中粘贴很多无关的格式 我认为下面的 * shell脚本行* 有一些特殊的东西,但我并不真正理解shell脚本(还有很多其他的东西) - 非常欢迎任何帮助

脚本是

set source_folder to "source" as alias
set output_folder to "output" as alias
tell application "Finder"
set theFiles to (files of entire contents of source_folder) as alias list
end tell
repeat with aFile in theFiles
    tell application "Finder"
        set fileName to name of aFile
        set fileExt to name extension of aFile
    end tell
    set outputPath to (output_folder as text) & text 1 thru -((count of fileExt) + 1) of fileName & "txt"
    ***do shell script "/usr/bin/textutil -convert txt -output " & quoted form of POSIX path of outputPath & space & quoted form of POSIX path of aFile
end repeat***
tell application "Finder"
    set theFiles to (files of entire contents of output_folder) as alias list
end tell
repeat with aFile in theFiles
    tell application "Finder"
        set theName to name of aFile
        set theText to (read aFile)
        set the clipboard to theText
        set theDialogText to "The Name of the file is " & theName & " " & (the clipboard)           
        tell application "FileMaker Pro Advanced"
            activate
            delay 1
            tell document "the filemaker database"
                go to layout "the required layout"
                create new record
                go to last record
                do script "Trial" --a filemaker script that simply pastes clipboard contents into a field
                end tell
            end tell
    end tell    
    end repeat

0 个答案:

没有答案