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

@Sophie: Indeed the knowledge that we’ll be able to use MacRuby to interface to the Applescript instead of the infernal syntax of applescript itself – delicious!!!

I realize I’m a bit late to this particular thread, but here’s what I’d like to see:

  1. Full access to the binder, with documents as objects (with each one having a ‘name’ property, to make them easier to work with), and relative movement (using words like ‘left’, ‘down’, ‘right’, ‘up’), as well as the ability to move an object “into” or “out of” another one; i.e., “Move documentOne into documentTwo” or “Move thisDocument out of thisFolder”)

  2. Full access to the current editor window (and of course the ability to switch between editors and to make objects in the Binder active), with a few general text editing commands, and the ability to adjust the properties of text objects and selections.

  3. At least partial access to the Compile window, and the ability to use AppleScript to set formatting options for a Project, and especially to create and adjust properties of objects in the Formatting pane, and the ability to select compile formats and presets.

  4. Commands for file import and export commands, to possibly use in conjunction with Binder objects.

Other than of course making Scrivener fully open to GUI scripting through AppleScript (which is usually regarded as the ‘hard’ way to make AppleScript do stuff), this is about all I can think of.

—A.H.

Not so much Apple Script but related: enable the user to run applescripts/ scripts from either an application menu or an icon on a customised toolbar. See OmniOutliner for example.

Simon

I’m also a bit late to this thread, and worse, don’t know anything about scripting. But I do use Bookends, and it seems the developer has recently improved its Applescript capabilities:
sonnysoftware.com/phpBB3/vi … f=6&t=3161
sonnysoftware.com/phpBB3/vi … f=6&t=3122

So if there’s any easy and useful way to get Scrivener to tap into Bookends that’d be great…

I was in touch with Jon at Sonny about this recently, in fact. I’m not sure it will add an awful lot to Scrivener’s integration with Bookends seeing as it’s probably better to scan documents once they have been exported to RTF, but it’s on my list for further investigation.

One thing I wanted to be able to do and hope an Applescript dictionary would enable: I want to export my Scrivener research folder into a standard filesystem hierarchy with documents (mostly PDFs) renamed to the names they have in Scrivener. So I suppose a script would need the ability to read the binder structure and binder names at the very least, even better would be to also enable export of document notes as a txt file with the same name as the document.

The same way Export Files works now?

How did you sneek that feature in there without me realising!? Is there some sort of nefarious backdoor in Scrivener that allows you to keep adding features I need just to make me look an nincompoop on a public forum? :confused:

I’m sure you’ll tell me that has been in Scrivener (gold) since V0.0005, are you playing with my memory too? :open_mouth:

Fine. :blush:

(many thanks, that is exactly what I wanted!!!) :smiley:

Well, I didn’t want to mention it, but… :slight_smile:

Glad that’s what you were after!

Mischief managed.

There’s a script for that? Wow! :slight_smile:

Any update on this? I just bought Scrivener and my life is changed. I’m excited about the ability to augment the app and add it into heavily scripted workflows like those found here.

• One feature I’d like to script would be the ability for Scrivener external links to link directly to the actual page of a .pdf that I am referencing - I would think that .pdf page number would be a dead-simple hook?. Scrivener is basically taking the place of DevonThink for a lot of my workflow…

• I am also using scrivener to import large amounts of different types of notes from Skim. So hooks for creating text pages would be great (I think importing notes as text pages is better than as notes/comments, since they need metadata, links, etc.).

• On that note, I would LOVE hooks to create metadata (of all types), and links. I want to be able to add semantic data to my imported notes - such as links to the pdf they are on, custom metadata for author of the article referenced, page number, etc. Since I have a script to export notes from Skim based on colour, type, and page, it would be amazing to then write a script to import those notes into Scrivener based on the same data - (ie a blue highlight means “author to follow up on”, and I have a folder in my Scrivener workflow for “Key Researchers”, so it would be great to be able to automate the connection between the two)

Hooks for splitting documents based on expressions. Presently you can only do this on import, meaning you can’t add metadata to a document before splitting it, resulting in a lot of repetition.

• Also on that same idea, hooks to create notes/comments with a way of locating them in the text or over a .pdf would be great. Skim has all sorts of hooks and it looks like I could potentially write a script to export notes with their locations and sync them into Scrivener

• Not directly Applescript-specific, but I would like the ability to create “types” of text files - types in this case relating to the custom metadata fields that appear. An “advanced custom metadata” option would be great too, to allow dropdowns, radio buttons, etc in custom metadata.

• While I’m requesting features, I find it really annoying that I can’t edit most metadata with multiple documents selected. It would be really helpful if I could add a tag to 100 pages at the same time instead of adding a tag 100 times…

• Is there any possibility of text anchors for internal links, like you can do with HTML and in Adobe .pdf software? Would be great if my internal links could point to a specific position in a document

• While you’re contemplating scripting hooks, another great feature along the same lines would be to also connect those hooks into the internal linking system - so that without writing an Applescript I can hyperlink to a specific action in Scrivener from another app/document or HTML page using the x-scriv… hyperlink prefix. My understanding is that DevonThink offers this kind of thing and it would be really great. (example use-case: add a link in my notes to specific page of .pdf they relate to, or if internal link anchors are implemented, to a specific location in a long Scrivener document/specific view of binder and other documents in Scrivener… etc.)

I absolutely LOVE Scrivener and the design philosophy behind it… I never usually get involved in software forums, or even use paid software (I heart Opensource), but I knew as soon as I got into the Scrivener tutorial that I was going to buy it. There are so many awesome features I don’t even know where to start… internal linking… the ability to import research files as aliases… custom metadata… So apologies for the long post of ideas, but I’m stoked.

.

On your Point #7:

If by ‘tag’ you mean label, status or keyword, you can already do what you are asking for, but you need to take the action directly on the selected group of items in the Binder, not in the Inspector.

You can control-click any of the selected docs to add label or status to the whole selected group of docs. You can also drag and drop a keyword (from the Project Keywords floater window) onto one of a group of selected docs to apply the keyword to them all.

–Greg

Thanks Greg! This has been pointed it to me elsewhere as well :blush:

I’d prefer python support with Cocoa bindings so we can make our own GUI plugins easily. AppleScript is simply awful!

Hello,

My 2 cents.

background: I am new to scrivener and I have not used AppletScript. I am a software/firmware engineer by trade.

I have been thinking of asking for a plugin for a while then I saw this post.

I want to stress that after having refused to use Mac OS since I gave up my Mac SE, I just purchased a Mac because I wanted some features of Scrivener Mac I could not find in the Windows version.

While I would love to see AppletScript support with read/write access to internal objects + calls to published methods; I would love, even more, these features to be platform/programming-language-agnostic.

Plugins are good for that: Scrivener would publish some install/init protocol and then some “hook” methods, which could then be used by any language that can access shared libraries / dll. This would also allow the feature to be accessible under Windows, even if phased; while sticking to AppleScript would most likely rule Windows out (stackoverflow.com/questions/2631 … on-windows).

That’s my take / would love to help test a Python plugin :wink:

Regards,

Philippe

+1 for Phillipe’s ideas

I’d love to see python scripting support. I don’t use AppleScript, though I understand it’s necessary for Automator support, which would also be a nice to have.

Would it make sense to move this out of the Mac forum to a more cross-platform discussion of automation?

I started one here:

[url]https://forum.literatureandlatte.com/t/automation-beyond-applescript-which-has-never-been-implemented-anyway/33698/1]

but mostly just stopping back in to see if anything is in the works to accompany the iOS version.

I realize that this topic is dead in the water, but I’m constantly finding use scenarios…it would be great to be able to script adding keywords to documents. I’d write a Service that would allow me to right-click text in any MacOS app and add it as a keyword to the active document in Scrivener. That would be so useful for note-taking and coding.