如何显示&lt; <data ...>&gt;在AppleScript中显示对话框命令?</data ...>

时间:2013-01-14 09:08:39

标签: binary applescript

我检索图像文件的二进制内容,如: «数据JPEGFFD8FFE000104A46494600010101004800480000FFDB00430006040506050406060506070706080A100A0A09090A140E0F0C1017141818171416161A1D251F1A1B231C1616202C20232627292A29191F2D302D283025282928FFDB0043010707070A080A130A0A13281A161A28282828282828282828282828282828282828&GT;&GT; 我想通过“display dialog”命令显示这些数据。但我得到的错误就像“不能使&lt;&gt;到字符串”。那么有没有办法使用显示对话框显示这些数据?

1 个答案:

答案 0 :(得分:1)

尝试:

set xxx to «data JPEGFFD8FFE000104A46494600010101004800480000FFDB00430006040506050406060506070706080A100A0A09090A140E0F0C1017141818171416161A1D251F1A1B231C1616202C20232627292A29191F2D302D283025282928FFDB0043010707070A080A130A0A13281A161A28282828282828282828282828282828282828»
try
    set xxx to xxx as text
on error errMsg
    set errMsg to do shell script "echo " & quoted form of errMsg & " | grep -o «.*»"
    display dialog errMsg
end try