Action

Add Lines to List (caller)

Posted by @JimS, Last update 11 days ago - Unlisted

UPDATES

11 days ago

Updated to be compatible with Add Lines to List, v5.0.

show all updates...

11 days ago

Updated to be compatible with Add Lines to List, v5.0.

about 1 year ago

Updated to be compatible with Add Lines to List, v4.0.

Use this action to call action Add Lines to List, v5.0+.

Instructions

  1. Install Add Lines to List | Drafts Directory. It will have a red icon.

  2. Install this action. It will have a green icon.

  3. Copy and rename the copied action.

  4. For the renamed action, open the Script step and set the options as needed.

  5. Select a draft and run this action.

Steps

  • script

    // The UUID of a specific draft to use as the source instead of 
    // the currently displayed draft. If set to '', the action will
    // use the currently displayed draft. If set to '0', the action
    // will use the last modified draft as the source.
    // Note: If this is set to a draft with tag=listTag, then the 
    // list will will not be modified, but it will be opened in the 
    // editor and previewed.
    let _sourceUUID = '';
    
    // Controls the action behavior: '' | update_only | preview_only
    // - '': normal behavior (with sourceUUID capability if specified)
    // - 'update_only': only update the target list, no dialog, preview, etc.
    // - 'preview_only': only preview (current draft if it has listTag, 
    //   theListTitle if specified, or user-selected list)
    let _quickAction = '';
    
    // The tag used for target lists.
    // Note: The target lists must also be archived.
    let _listTag = 'list';
    
    // The target list that will be updated. If set to '', the action
    // will search for all archived drafts that include a tag=listTag.
    // A dialog will appear that includes these drafts and an
    // additional option to specify a new list.
    let _theListTitle = '';
    
    // The markdown heading level for target lists. If '', '###'
    // will be used.
    let _newListHeading = '###';
    
    // The markdown font size for target lists. If '', '80%'
    // will be used.
    let _theListFontSize = '80%';
    
    // The markdown font family for target lists. If '',
    // '"Courier New", Courier, Monaco, "DejaVu Sans Mono", monospace'
    // will be used.
    let _theListFontFamily = '"Courier New", Courier, Monaco, "DejaVu Sans Mono", monospace';
    // let theListFontFamily = '"Helvetica Neue", "Helvetica", sans-serif';
    
    // -------------------------------------------------------
    // Boolean options below can be displayed (and changed) at
    // runtime if promptOptions = true
    // -------------------------------------------------------
    
    // If true, leading and trailing blank lines are ignored
    // as the displayed draft is processed for addition to the list.
    let _trimDraft = true;
    
    // If true, blank lines after the top text line and before 
    // the bottom text line are ignored when the displayed draft
    // is processed for addition to the list.
    let _excludeInnerBlankLines = true;
    
    // If true, appends/prepends `---` if the existing adjacent 
    // line in the list is not `---`.
    let _addHorizontalRule = false;
    
    // If true, appends/prepends `---` (if the existing adjacent 
    // line in the list is not `---`), appends/prepends 
    // YYYY-MM-DD DayOfWeek, appends/prepends `---`.
    let _addCurrentDateToEachBlock = true;
    
    // If true, lines from the displayed draft are prepended
    // to the list; otherwise lines are appended.
    let _prependLines = true;
    
    // If true, a `YYYY-MM-DD HH:MM: ` or a `HH:MM: ` prefix is 
    // added to each line before it is added to the list. It will
    // be the latter if addCurrentDateToEachBlock = true.
    let _addCurrentTimeToEachLine = true;
    
    // If true, the target list is loaded into the Drafts Editor
    // after it is updated.
    let _viewListAfterSuccess = false;
    
    // If true, the target list is previewed using 'HTML Preview'
    // after it is updated.
    let _previewListAfterSuccess = true;
    
    // If true, the action displays a dialog that includes boolean 
    // options: trimDraft, excludeBlankLines, addHorizontalRule,
    // addCurrentDateToEachBlock, prependLines, addCurrentDateToEachLine,
    // viewListAfterSuccess, previewListAfterSuccess.
    let _promptOptions = true;
    
    // -------------------------------------------------------
    // Boolean options below can be displayed (and changed) at
    // runtime if an empty draft is visible when the action is
    // is run and promptOptionsIfDraftIsEmpty = true.
    // -------------------------------------------------------
    
    // If true, the target list is loaded into the Drafts Editor
    // if an empty draft is visible when the action is
    // is run.
    let _viewListIfDraftIsEmpty = true;
    
    // If true, the target list is previewed using 'HTML Preview'
    // if an empty draft is visible when the action is
    // is run.
    let _previewListIfDraftIsEmpty = true;
    
    // If true, the action displays a dialog that includes boolean 
    // options viewListIfDraftIsEmpty and previewListIfDraftIsEmpty
    // if an empty draft is visible when the action is
    // is run.
    let _promptOptionsIfDraftIsEmpty = true;
    
  • includeAction

    name
    Add Lines to List

Options

  • After Success Nothing
    Notification Info
    Log Level Info
Items available in the Drafts Directory are uploaded by community members. Use appropriate caution reviewing downloaded items before use.