-1

We have an internal system built in Filemaker Pro 12. We have a script that will combine two files together to make a PDF. Then our system calls up the below applescript to convert that PDF into a Jpeg. We get the error: Expected end of line etc. but found identifier.

I have found several posts, but I am not able to get an answer from those posts that solve my issue. FYI... The ftp site below was changed on purpose, it is correct in our system. Any help would be greatly appreciated, let me know if you have any questions.

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"
Raptor
  • 53,206
  • 45
  • 230
  • 366
  • 1
    Seems like a syntax error in the compiled AppleScript--which is easy to have given the complexity of the code. Try breaking the script into small chunks and testing those individually to see if you can find the problematic line(s). – pft221 Oct 21 '13 at 15:26

1 Answers1

0

Syntax errors in AppleScript are difficult to debug from FileMaker. Evaluate the calculation (use Data Viewer in FMA or make your own in FMP) - this will give just the AppleScript code. Paste it into AppleScript Editor (in Utilities). It should tell you exactly where the error is.

Jason Wood
  • 351
  • 1
  • 5
  • 13