The issue is that AppleScript never works the way it's supposed to. It's a broken language by design, made worse by an not-even-alpha- stage implementation.

Selections in Skim should be expressible either as a specifier ("characters X thru Y of text of page Z of document 'Foo'") or as a list of specifiers, because selections can be disjoint. So therefore script commands should accept both forms. Hence, I declared the type for the various command parameters as "specifier or list of specifier". This is totally valid and the documentation recommend it this way for this situation. In fact, Apple recently used this for its own built-in commands, and I had to change that a while back because it broke the "open" command for a similar reason. However Apple's Cocoa Scripting mechanism fails to recognize it (it fails to validate the input). The reason, I think, is that it tries to interpret the list it gets as a specifier (because that's the first of the 2 types) and fails, because it's a list rather than a specifier. It should then go on and check the second one (list of specifier), but apparently it doesn't. I filed a bug on that. with Apple.

The fix changes the type to just "list of specifier". This means that selections now always have to be given as lists, and something like just "characters X thru Y of ..." will not be accepted. BTW, it still should, because AppleScript is supposed to be able to automatically coerce (transform) any object into a list by just wrapping it in a single-item list (so any object can be interpreted as a list). But that's another bug (also reported).

I could go on for a few more days about such bugs, and when you're using AppleScript you'll certainly meet some of them.

Christiaan


On 4 Feb 2009, at 2:57 AM, Eric Goldberg wrote:

Thanks Christiaan. This works now. Out of curiosity, what was the issue? We can take it offline if you want (not sure if this is a verbose list or a quiet list as I just joined)

cheers,
e

On Tue, Feb 3, 2009 at 5:53 PM, Christiaan Hofman <[email protected]> wrote: To fix this, open Terminal.app, write the following on a single line (!), and hit Enter:

curl http://skim-app.svn.sourceforge.net/viewvc/skim-app/trunk/Skim.sdef?revision=5192 > /Applications/Skim.app/Contents/Resources/Skim.sdef

Afterwards, make sure you relaunch both Skim and Script Editor.

Christiaan


On Wed, Feb 4, 2009 at 2:30 AM, Christiaan Hofman <[email protected]> wrote: Sigh. This used to work. Apple seems to have broken AppleScript again, if it wasn't already broken.

Christiaan

On 4 Feb 2009, at 1:51 AM, Eric Goldberg wrote:

One more issue: I keep getting an AppleScript Error: "Can't get characters X thru Y of text of page Z of document 'foo'"

I'm not too familiar with AppleScript, so if someone can point me in the right direction that'd be great. I know other scripting languages, but I'm unsure of how to catch an exception or handle invalid input characters in the "repeat" ("while?") loop "repeat while theSel is not {}"

Thanks,
Eric

On Tue, Feb 3, 2009 at 4:39 PM, Eric Goldberg <[email protected] > wrote: Thank-you, Christiaan! I don't know how I missed that. Maybe I was using the wrong search terms. :)

For anyone else who wants to see: 
http://apps.sourceforge.net/mediawiki/skim-app/index.php?title=AppleScript#Example_Scripts

(2nd script)

thanks again,
e


On Tue, Feb 3, 2009 at 4:33 PM, Christiaan Hofman <[email protected]> wrote:
That's typically something for AppleScript to do. In fact, the Wiki
links to a sample script doing exactly this.

Christiaan

On 4 Feb 2009, at 1:28 AM, Eric Goldberg wrote:

> Hello,
>
> I'm going through PDFs of a year's worth of phone bills. I want to
> use Skim to automatically highlight every instance of a certain
> telephone number.
>
> Right now, I'm searching and for each result, clicking the highlight
> button (This means repeatedly hitting Command-G, click, Command-G,
> click hehe)
>
> Is there any way to tell Skim to highlight all instances of a
> string? I searched the wiki, the manual, and the FAQ to no avail.
>
> Thanks,
> Eric


------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM) software. With Adobe AIR, Ajax developers can use existing skills and code to build responsive, highly engaging applications that combine the power of local resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
_______________________________________________
Skim-app-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-users


------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM) software. With Adobe AIR, Ajax developers can use existing skills and code to build responsive, highly engaging applications that combine the power of local resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications 
today-http://p.sf.net/sfu/adobe-com_______________________________________________
Skim-app-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-users

------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
_______________________________________________
Skim-app-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-users

Reply via email to