AppleScript: what do you want to see in the Scrivener Suite?

I’m afraid for once, AmberV, your reasoning doesn’t hold. You forget that those of us who have paid for ADC membership are already running older, less stable Leopard seeds. I’m running a seed from two months ago to develop Scrivener (it has to be linked using the latest version of Xcode to run on both Leopard and Tiger) and Xcode crashes on me regularly.

And I’ve already moaned elsewhere how the Leopard Early Start Kit page actually advertises access to the “latest” versions of Leopard, so really, there is even a case for dodgy advertising here, too. Nope, I am really, really angry about this. It is Apple at their worst.

Best,
Keith

It’s been a while since anyone posted to this topic - I suppose you’ve got the latest Leopard seed by now though (I hope!)

My question is when will Scrivener be available for Leopard, given it smells like the cat is close?

My trial expired just as a few other more immediate expenses piled up, but I do plan to buy in about a month (I really miss the program!) so I’m wondering about your Leopard timing? Any comments you can make?

Oh, and in the meantime (after you put up your Leopard version but before I can afford it!), will you be updating your site with nice-looking screenshots, so I can know what I’m missing out on? :slight_smile:))

Hi,

The beta in the Beta Testing forum is Leopard-ready. The 1.09 beta will be out in a day or two, then 1.1 will be released officially before Leopard hits the shelves (unless Apple just drops it on the shelves without announcing it). The site will be updated with new screenshots at the same time as 1.1 comes out.

And by the way, the 1.08 beta in the Beta Testing forum restarts the trial and gives you 30 days of actual use, so you can continue using the program for a while longer if you download it. :slight_smile:

All the best,
Keith

Thanks, I downloaded it and it looks great!

It’s even better than I remember from a few weeks ago.

Definitely on my “buy” list.

I just got my first Mac, and saw the plug for Scrivener on Slashdot, so I gave it a try. It looks GREAT. The first thing I thought after running through the tutorial is how this would help in writing blog posts. The research and link collection features would be helpful, and if the posts are all collected in Scrivener, it would make selecting certain ones and merging them into a book (someday) really easy as well.

I’m not familiar with Apple script (yet), but I’m guessing the uploading could be automated if there is script access to the files in the binder and the file metadata, especially status, so the script could know what articles and associated files (images, etc) need to go up. The ability to add arbitrary custom metadata fields would be very helpful to this as well. I think this feature would be inappropriate for the main program, but very doable with AS/Cocoa given the right interface exposure.

AUTOMATOR SUPPORT
developer.apple.com/macosx/automatormarket.html

developer.apple.com/documentatio … mator.html

macdevcenter.com/pub/a/mac/2 … mator.html

spiderworks.com/books/automator.php

Am I the only one who doesn’t know what AppleScript or Automator are for?

Nope. I say that as someone who does know, but who has provided others a longwinded and meandering answer several times lately. It all boils down to providing you the ability to extend, automate, or combine various components of your system. When you need to use either, they will suddenly start making sense.

At least I think it all boils down to that.

I’d love to see robust Applescript support. Of the mac word processors I think Pages has the best Applescript support – I’d look at the Pages dictionary for an idea of the possibilities.

To give an example of its advantages – Jim Harrison has been able to write a BibDesk (BibTex-focused bibliography manager) for Pages using Applescript – jhh.med.virginia.edu/main/CiteInPages. I thought about doing the same thing for Nisus Writer Pro & realized that NWP’s Applescript support is pretty limited, with not much more than TextEdit and developers who are focusing on a proprietary Perl-based macro language instead of Applescript (don’t get me started on that…).

I would expect that Pages would have the best AppleScript support given that it is written by Apple themselves. :slight_smile: The trouble is that Pages isn’t really comparable to Scrivener, as Scrivener isn’t a straight word processor. There are a thousand other commands you would need to control the binder and stuff too…

I’m hoping to look more at AppleScript support after the next update, though.

All the best,
Keith

Think of Applescript as a way to automate multiple applications and you’ve got what you need to add as a minimum. For example, I think of Applescript more in terms of what I want to DO than what functionality a specific application would have. One I know what I want to do, then I can determine what to add to an application.

For example:

  1. I’d like to be able to automate the whole process of collecting and moving a draft into a word processor and them imposing some standard template to it for my publisher. On the Scrivener side, I’d need to be able to select all of the draft documents, assemble them, then export them (I’m assuming I understood all this in the tutorial, so forgive my ignorance if I’ve got something wrong). You can see the need … one the file exists, Applescript can handle the rest from there as long as my target application can handle the other parts.

  2. I’d like to be able to automate producing a sample chapter as part of a proposal so I can collect all the stuff I need to get to an agent or publisher formatted appropriately. Again, the formatting can be handled by the Word Processor or layout program, that’s not your issue, but choosing the draft elements, assembling them, and passing them out to the word processor are your parts.

  3. I’d like to be in a word processor or online web surfing or somewhere else and be able to hit run a script that would take some element (say a web page) and insert it into a Scrivener project under the appropriate research heading without having to run Scrivener directly. Apple script will allow me to automate things like that if the applications I’m using allow it.

Here’s a specific task I’d like to be able to do with Applescript.

With text selected, 1. copy the selection, 2. create a new document in a folder called Cuts, 3. paste the selected text in the new document, 4. set the synopsis of the new document to the first 20 words of the selected text, 5. delete the selection from the source document.

I do this all the time with stuff that I want to cut but keep around - it would be great to automate it. Steps 1, 3, and 5 are all doable with Applescripts core language features. So what’s needed from Scrivener is a way to create the new document and make its body and synopsis available as a target for pasting, and to switch back to the source document.

That’d be awesome!

What Derick said. Good idea.

ps

Actually, you do not have the ability to do step 3 via Applescript unless you mean invoking the menu Paste function. But you would not want to have to do that in your script (because it means changing what is in an editor window, etc.). Rather, you would just want the ability to get and set the contents of a document’s body and synopsis.

Another, related application would be to loop through every folder and document within a source folder, and create a corresponding empty folder in a new folder.

e.g. one could start with

Drafts
…intro
…body
…part one
…part two
…conclusion

run the script on it and create a new folder hierarchy with a root folder Cuts

Cuts
…intro
…body
…part one
…part two
…conclusion

Alternatively the actual program flow could be to duplicate the source, then set the text of each document/folder in the target to be blank.

To accomplish these sorts of tasks in Applescript all that would need to be supplied in the Applescript Suite by the application is the ability to get and set the contents of documents together with the ability to interrogate the binder list and create new folder/docs in it.

From the Suite perspective, this is just to supply language for addressing oneself to the basic scrivener objects–no scrivener-specific functions would yet be involved.

I guess making an app Applescriptable can be hairy, but when Applescriptability comes to Scrivener, the kinds of procedures you are imagining require only basic access to Scrivener objects, it seems pretty well assured they would be possible.

–Greg

Here’s another problem I’d like to solve with Applescript. I have a document in which footnotes are currently in the text, with FN: at the start of the paragraph. I’d like to loop through each paragraph in the document, and if it begins with FN:, delete the text FN: and convert the paragraph to a Scrivener footnote.

More food for thought.

And another. I am setting up a project with a series of numbered documents (1.1, 1.2, 2.1, 2.2 etc., representing weeks of term/classes per week) and would love to be able to write a script (which would be more-or-less for x=1 to 15; for y=1 to 2; create a new document with name x,y; end for; end for) to create the documents.

Why not just use the existing counter tokens for that? <$n> will give you your week number and <$sn> the class number. <$sn> is linked to <$n> in that it will count up until the next instance of <$n> and then resets to 1.

I want to do something rather simple with AppleScript. At least I thought it was simple until I saw that Scrivener doesn’t support AppleScript.

I want to take notes from the web and get them into Scrivener, but with more information saved than a Clipping. And easier and faster than Services.

I want to select some text in the browser and create a new document in Scrivener with the title set to the first few words, the text in the body, all or some part in the synopsis, and the url in the references.

Here is a sample Applescript for OmniWeb and DevonThink doing something similar:

	set this_url to address of browser 1
	set this_selection to do script "unescape(getSelection())" window browser 1
	set this_title to the name of browser 1
	
	tell application "DEVONthink Pro" to create record with {name:this_title, type:txt, URL:this_url, plain text:(this_selection & return & return & this_url)} 

So for Scrivener, all I need is to be able to create a document and set the various properties.

Another thing I though of doing with AppleScript:
Go through all the documents or selected documents and if there is no synopsis, set the synopsis to the text or the first few words.

I have a lot of notes and I’d like to organize them using the cork board, but they don’t have synopses.

Thanks,
Linda