On Feb 17, 2014, at 4:42, Christian Boyce wrote:
> Howdy. I have an AppleScript that uses Skim to rename a PDF based on the
> PDF's content. Part of that script goes like this:
>
> tell application "Skim"
> open theFile
> tell document 1
> tell page 1--
> sometimes I get an error here
> set
> pdftext to (get text for) as string
> end tell
> end tell
> quit
> end tell
>
> ("theFile" is a file on the disk, full path supplied).
>
> The strange part is, sometimes I get an error when I try to save this script.
> I get this message, with the "1" after "tell page" highlighted:
>
> Syntax Error. Expected end of line but found number.
>
> The script compiles fine but every so often, if I'm in the script trying to
> improve things-- even if all I do is delete a line and retype it-- I get that
> "Syntax Error. Expected end of line but found number."
>
> My work-around has been to change the first line to say something like this:
>
> tell application "adlsasdfasdf"
>
> so then when I compile they ask me where's that app, and I can point to Skim,
> and then it compiles perfectly… but when I try to SAVE the script I get the
> Syntax Error again.
>
> But sometimes, for some reason, it all works fine.
>
> I checked the box to open Skim in 32-bit mode and it seemed to help… but I'm
> not sure it's really solved. Is it a bug, or maybe just some scripting
> extension in my system here?
>
> 10.8.5, iMac. Skim 1.4.8.
AppleScript is a very unreliable language, and very unpredictable. What you say
seems even weirder than I know of, because it does not relate to any of the
(many) ambiguities I know of, it's in the very standard part of AppleScript.
Unfortunately I cannot say much about it. Sometimes such ambiguities arise from
scripting extension you may have on your system. As you have the problem with
the document line, perhaps you can try "front document" instead of "document
1". But it's hard (i.e. impossible) to predict what works and what doesn't with
AppleScript.
Christiaan
------------------------------------------------------------------------------
Android apps run on BlackBerry 10
Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
Now with support for Jelly Bean, Bluetooth, Mapview and more.
Get your Android app in front of a whole new audience. Start now.
http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk
_______________________________________________
Skim-app-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-users