2013-10-21 35 views
-1

我們有一個內置系統在Filemaker Pro 12內置。我們有一個腳本,將兩個文件結合在一起,使PDF。然後我們的系統調用下面的applescript將該PDF轉換爲Jpeg。我們得到錯誤:期望的行結束等,但找到標識符。FilemakerPro 12運行applescript將PDF轉換爲Jpeg。預計行結束等,但找到標識符

我發現了幾篇文章,但我無法從解決我的問題的帖子中獲得答案。 FYI ...下面的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" 
+1

好像在編譯的AppleScript語法錯誤 - 這是很容易給該代碼的複雜性。嘗試將腳本分成小塊並單獨測試,以查看是否可以找到有問題的行。 – pft221

回答

0

AppleScript中的語法錯誤很難從FileMaker中調試。評估計算(在FMA中使用Data Viewer或在FMP中創建自己的計算器) - 這將只提供AppleScript代碼。將其粘貼到AppleScript編輯器(在實用程序中)。它應該告訴你確切的錯誤在哪裏。

相關問題