- AuthorPosts
- October 11, 2023 at 7:56 am #29503tuskaParticipant
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.October 11, 2023 at 8:54 am #29504Patrick CParticipantI 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);
October 11, 2023 at 10:36 am #29505tuskaParticipant2Patrick 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);
October 11, 2023 at 10:49 am #29506Patrick CParticipantGlad I could help 😀
Thanks for the feedback!November 2, 2023 at 7:17 am #29532tuskaParticipant@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.
November 2, 2023 at 8:18 am #29533Yutaka EmuraKeymasterHello,
You can run the Snippets plug-in as background. Please go to the Snippets Properties, and check the “Run Background” check box.November 2, 2023 at 1:10 pm #29534tuskaParticipantThank you for this information.
Now everything works as desired for me.Regards,
Karl - AuthorPosts
- You must be logged in to reply to this topic.