Skip to content

New function %dateformat.current()% to insert current date without switches in sandbox script #356

Description

@RealRaven2000

Similar to issue #353 we also need a reliable date format variable for the sandscript that displays the current date (at time of running the script)

Example for using it to prefix a date to the subject line

%{% 
  (async () => {
    var val = await dateformat_current("Ymd_");
    header_prefix($subject,val);
    return "";
})()
%}%

Activity

  1. self-assigned this
    on Feb 6, 2025
  2. RealRaven2000 commented on Feb 6, 2025

    @RealRaven2000
    OwnerAuthor

    Here is a preview version with the new variable. I had to add some logic around (not calling) the util.wrapDeferredHeader() function which was designed to resolve unknown variables in new emails by creating a clickable field. This is not useful when in a sandbox where we just need to immediately evaluate strings / text variables to be further processed by script.

    smartTemplate-fx-4.10.2pre4.zip

    Further to this, it might be valuable to be able to determine the current composeCase (e.g. "new" "reply" " forward" "editAsNew" etc.) or the simplified st4composeType (just one of the three valuse "new" "rsp" and "fwd"). So I want to consider adding a variable within the sandbox to read out these states to take appropriate actions.


    To try out this version, download the zip file and then drag it into Thunderbird Add-ons Manager (without extracting)

  3. changed the title [-]New function %dateformat.current()% to insert current date without switches in sandbox script[/-] [+]New function `%dateformat.current()%` to insert current date without switches in sandbox script[/+] on Feb 9, 2025
  4. added a commit that references this issue on Feb 9, 2025
  5. RealRaven2000 commented on Apr 9, 2025

    @RealRaven2000
    OwnerAuthor

    Implemented in 4.11 - Published 05/04/2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions