Apple Script - Syntax Error

Hi,

New to apple scripting and hoping to get some advice on a Syntax error I'm getting in some code;

Expected end of line, etc. but found identifier.

set svgFile to export myDoc to file ((path to desktop as string) & "clipboard.svg") as SVG with options ¬
{sVGAutoKerning:false, sVGIncludeFileInfo:false, sVGIncludeUnusedStyles:true, sVGObjectIDPrefix:""}
set activePresentation to active presentation
set activeSlide to slide selection of slide view of active window of activePresentation

The highlighted section in the error is myDoc, presentation and selection

Any guidance on what's causing this would be greatly appreciated.

Thanks

Nobody can answer this without your target application.

AppleScript is a kind of conversation with other application (target).

So, you have to tell with some application (Keynote? Microsoft PowerPoint? Adobe InDesign?).

And...the target application must placed at your machine. We can not compile (check syntax and translate into AppleEvents code) AppleScript without target application binary.

Understood. As I said I'm new to this and wasn't sure how much of the code you'd need and how much would just be distracting.

The whole code block is;

set illustratorLabel to "Adobe Illustrator"
set powerpointLabel to "Microsoft PowerPoint"
set buttonLabel to "Paste on Active Slide"
display dialog "Please ensure the object you want to copy is selected in Adobe Illustrator before continuing." with title dialogTitle buttons {"OK"} default button "OK"
set aiApp to application illustratorLabel
set pptApp to application powerpointLabel
set svgClipboard to ""
tell aiApp
activate
tell front document
set selectionCount to count selection
if selectionCount is 0 then
display alert "Please select an object in Adobe Illustrator before continuing." as critical
return
end if
set selectedPathItem to first item of selection
set name of selectedPathItem to "Selected Object" -- set a name for the object to be used in the SVG
set myDoc to it
set svgFile to export myDoc to file ((path to desktop as string) & "clipboard.svg") as SVG with options {sVGAutoKerning:false, sVGIncludeFileInfo:false, sVGIncludeUnusedStyles:true, sVGObjectIDPrefix:""}
set svgClipboard to read svgFile
close svgFile without saving
delete file "clipboard.svg"
end tell
end tell
tell pptApp
activate
set activePresentation to active presentation
if activePresentation is missing value then
display alert "Please open a presentation in PowerPoint before continuing." as critical
return
end if
set activeSlide to slide selection of slide view of active window of activePresentation
tell activeSlide
make new picture at end with properties {file name:svgClipboard}
end tell
display dialog "The selected object has been pasted onto the active slide in PowerPoint." with title dialogTitle buttons {"OK"} default button "OK"
end tell

Any guidance, or pointing me in the direction of the right resources to solve this is greatly appreciated.

Apple Script - Syntax Error
 
 
Q