-1

我们在 Filemaker Pro 12 中内置了一个内部系统。我们有一个脚本,可以将两个文件组合在一起以制作 PDF。然后我们的系统调用下面的applescript 将该PDF 转换为Jpeg。我们收到错误:预期行尾等,但找到标识符。

我找到了几个帖子,但我无法从那些解决我的问题的帖子中得到答案。仅供参考... 下面的 ftp 站点是故意更改的,它在我们的系统中是正确的。任何帮助将不胜感激,如果您有任何问题,请告诉我。

Unstored, from SnDesign to Same Designs, =
"set theFile to alias \"" & Substitute(Right(Get(DesktopPath);Length(Get
(DesktopPath))-1);"/";":") & "PDFTemplates:" & TemplateNamePDF & "\" "&
¶ &
"tell application \"Adobe Photoshop CS4\" "& ¶ &
"activate" & "¶" &
"open theFile as PDF with options {resolution:150, use antialias:
true}" & ¶ &
"set docRef to the current document" & ¶ &
"tell docRef" & ¶ &
"resize image width pixels 1298 height pixels 1696
resolution 150 resample method bicubic" & ¶ &
"save in \"" & Substitute(Right(Get(DesktopPath);Length
(Get(DesktopPath))-1);"/";":") & "PDFTemplates:" & TemplateNamePDF &
"\"" & " as JPEG with options {quality:6} appending lowercase extension with
copying" & ¶ & "end tell" & ¶ &
"close current document without saving" & ¶ &
"end tell" & ¶ &
"set theFile to alias \"" & Substitute(Right(Get(DesktopPath);Length(Get
(DesktopPath))-1);"/";":") & "PDFTemplates:" & TemplateNameJPG & "\" " &
¶ &
"tell application \"Finder\" " & ¶ &
"duplicate file theFile to \"RETAIL:" & Category & "\"" & " with
replacing" & ¶ &
"duplicate file theFile to \"Mac Volume:RETAIL CURRENT:
_JPEGS2File\" with replacing" & ¶ &
"end tell" & ¶ &
"tell current application" & ¶ &
"do shell script \"usr/bin/curl -T " & Right(Get(DesktopPath);Length
(Get(DesktopPath))-13) & "PDFTemplates/" & Substitute
(TemplateNameJPG;["(";"'('"] ;[")";"')'"]) & " ftp: //Domain Name/\" " & ¶ &
"end tell" & ¶ &
"tell application \"Finder\" " & ¶ &
"delete file theFile" & ¶ &
"end tell" & ¶ &
"set theFile to alias \"" & Substitute(Right(Get(DesktopPath);Length(Get
(DesktopPath))-1);"/";":") & "PDFTemplates:" & TemplateNamePDF & "\" "&
¶ &
"tell application \"Finder\" " & ¶ &
"duplicate file theFile to \"" & Substitute
(ApplescriptArtFolderPDFPathCalc;"/";":") & "\" " & " with replacing" & ¶ &
"end tell" & ¶ &
"tell application \"Filemaker Pro\"" & ¶ &
"activate" & ¶ &
"end tell"
4

1 回答 1

0

AppleScript 中的语法错误很难从 FileMaker 中调试。评估计算(在 FMA 中使用 Data Viewer 或在 FMP 中自己创建)——这将只给出 AppleScript 代码。将其粘贴到 AppleScript 编辑器(在实用程序中)。它应该准确地告诉您错误在哪里。

于 2013-10-22T15:31:40.030 回答