Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #29503
    tuska
    Participant

    Hi,
    Snippet-title: Date (date) (dd Tab)
    – OR –
    Snippet-title: Date (date) (dd Alt+Ctrl+.)

    Properties
    – Name: Date (date)
    – Trigger: dd
    – ✅ Use Default Shortcut
    – Type: Snippet
    – Text: ${Date}

    Entering dd and pressing the Tab key inserts the current date into a .txt file but only if the snippets were previously displayed.
    I would like the function to be possible WITHOUT having to show the snippets first.

    If I UNCHECK ‘Use Default Shortcut’ and save e.g. the shortcut Alt+Ctrl+. instead, it has no effect,
    regardless of whether the snippets are shown or hidden.

    Please check and if possible implement the suggestion.
    Thank you!

    PS:
    I know the menu “Insert” but very often I only need the current date.

    #29504
    Patrick C
    Participant

    I use the following .jsee macro, perhaps it helps (you could assign ctrl+shift+. to the macro, I use ctrl+D, which works reliably).

    var date = new Date();
    
    var dd   = date.getDate();           // returns the day of the month (from 1 to 31)
    if( dd < 10 )  dd = "0" + dd;
    
    var MM   = date.getMonth() + 1;      // returns the month (from 0 to 11)!
    if( MM < 10 )  MM = "0" + MM;
    
    var yyyy = date.getFullYear();       // Returns the year (4 digits)
    
    // “Output”
    document.write( yyyy + "-" + MM + "-" + dd);
    #29505
    tuska
    Participant

    2Patrick C
    Thank you very much for the prompt help! 👍

    I was able to slightly adjust and set up the macro.

    #icon="Datum.ico",0
    #title=Datum"
    #tooltip="Datum"
    var date = new Date();
    
    var dd   = date.getDate();           // returns the day of the month (from 1 to 31)
    if( dd < 10 )  dd = "0" + dd;
    
    var MM   = date.getMonth() + 1;      // returns the month (from 0 to 11)!
    if( MM < 10 )  MM = "0" + MM;
    
    var yyyy = date.getFullYear();       // Returns the year (4 digits)
    
    // “Output”
    document.write( dd + "." + MM + "." + yyyy);
    #29506
    Patrick C
    Participant

    Glad I could help 😀
    Thanks for the feedback!

    #29532
    tuska
    Participant

    @Author

    With regard to “Snippets”, I now assume that there will still be no change and that it is necessary
    to show all snippets first when using shortcuts (to the Snippets).

    This makes the shortcuts to the Snippets superfluous for me, however,
    because I can double-click on a snippet to insert it into a text file, for example.

    Furthermore, it is necessary to hide the snippets again afterwards.

    For me the issue is closed.

    #29533
    Yutaka Emura
    Keymaster

    Hello,
    You can run the Snippets plug-in as background. Please go to the Snippets Properties, and check the “Run Background” check box.

    #29534
    tuska
    Participant

    Thank you for this information.
    Now everything works as desired for me.

    Regards,
    Karl

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.