Finding empty data field in scrivener, and paste something in it

I use Scrivener, and it is great. In Scrivener I use 4 Metadata fields for input, which then will later be synced to Aeon Timeline. Sometime in my workflow I skip filling in the "Start" field (it will be in the form 2018-08-15).
This can be done manually, but I hope that I can use KM to automate this.
I have successfully made a macro that will paste a specific value into the field, but what I can't figure out is how to make the macro proceed to record 2, after finishing fixing record 1... and so on

And it should skip (maybe halt) if 'Start' is not empty

so how do one step down a list?
Palle

In the GUI a tab key seems to do that.

Perhaps worth trying something like this:

Untitled

1 Like

Thank you... for me its the "Down arrow" that moves to next record. But I still would like to have something that would check if "Start" is empty or not, and then, somehow, have the cursor move one step down as you suggest AND repeating same steps. possibly in a loop, which I am not familiar with.

What I don't know is how to find "next" item down, without clicking / indicating a specific starting place, being recorded inside the macro.
would like to click/ point on 'first item I want to start with and then the macro would do its thing and then find next record with empty Start

not so easy to formulate for me

Palle

Maybe I posted this in wrong place, before, but this is a crude macro that will do it ONCE, and then move cursor one step down
Palle

“Stepping down test 1” Macro

Stepping down test 1.kmmacros (8.8 KB)

Hey GreyT,

Try running this macro with the ⟨ Start ⟩ field blank and then again with it populated.

From there you should be able to tab through your elements.

-Chris


Populate ‘Start-’ Metadata Field.kmmacros (6.3 KB)

1 Like

Wauw. :slight_smile: Scripts are greek to me, but I'll have a go, as soon I have made a copy of a project to use as sandbox.
Right now I am considering an 'inverted' approach to the original problem, that Start: contains an illegal (in respect to Danish Standard) date.
I'll be back

P

My workspace:
I use Scrivener for research/ writing texts. For each text entry there will be chosen a Synopsis line (most often by selecting text from the body), and using the Scrivener hotkey for pasting selection into Synopsis.
After this has been done I will put the date the text was original created, In front of the synopsis, and the form for these dates are: yyyy-mm-dd followed by a blank. By doing it this way the entries will show up in chronological order, rather that alphabetical.

I am using Aeon Timeline together with Scrivener, and for this reason I have opened for using these 4 Custom metadata:
Start:
Participant:
Observer:
Event Arc:

The content of these fields are entered manually in Scrivener (reflecting the text-content) and all 4 are entered as Text.

Once I have synced the Scrivener project (with Aeon) I will get a nice, but sometime huge, matrix outlining the connections. I like that, it gives me a more intuitive picture compared to staying in Scrivener and using the excellent search there, one at a time.

So I am having the best of both.

Yet, as I do not really see the timeline, but mostly the matrix, this happens:
IF the Start: is empty on sync. Aeon will assign it to a kind of random date, and that date will flow back into scrivener on next complete sync… and those odd dates will pop up in my tidy project as maybe: Sat 2018-10-06

This I don’t want, so I make a search in Scrivener for this entry: Sat 2018-10-06 and will get a list of all entries containing this (yes, metadata IS included in search)

And now Keyboard Maestro rides to rescue. I have made a macro that will copy the first 10 characters (the date) of the synopsis and paste it by overwriting into Start: … and… redoing the search. Since the record just fixed does no longer qualify, number 2 on the list is now number 1.

Hooray and repeat :slight_smile:

For situations where there might be substantial number of entries to be fixed I have made another macro that will loop the first macro, x-times.

The macros as they are need to have Scrivener window in top-left corner, If you want to try them out you may have to adjust according to the screen you have, I use an iMac 27” - 5K.

“5_ScrivFix 3” Macro

5_ScrivFix 3.kmmacros (14 KB)

“6_Replace_5_times” Macro

6_Replace_5_times.kmmacros (4.3 KB)

I have reworked the macro, so no manual mouse-clics are used. Therefore the Scrivener window may be placed as you like it.

“5_ScrivFix 3 ver. B” Macro

5_ScrivFix 3 ver. B.kmmacros (73 KB)