Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions quick-commands/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## 0.3.0 - 2026-10-02

- Reworked for simplicity, efficiency and functionality.
- Custom commands can now have actual date/time values substituted by
using {dd}, {hh} and so on.
- Added README.md with extensive information.

## 0.2.0 - 2026-08-24

- Support quoted multi-word custom command values ([#297](https://github.com/qownnotes/scripts/issues/297)).
Expand Down
79 changes: 79 additions & 0 deletions quick-commands/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# `jv-quick-commands`

This is an augmented re-implementation of the QOwnNotes `quick-commands` script.

## How does it work

When this script is enabled, you can use the QOwnNotes auto-completion feature with a number of predefined completions.

| key | value |
| :----------- | :----------------------------------- |
| `\today` | Formatted current date and time |
| `\tomorrow` | Formatted date and time of tomorrow |
| `\yesterday` | Formatted date and time of yesterday |
| `\week` | Formatted week |
| `\now` | 2026-10-01T17:04:01 |

For date and time, a popup will allow choosing one of:
* `01-10` (day month)
* `01-10-2026` (day month year)
* `2026-10-01` (year month day)
* `2026-10-01T17:09:59` (ISO 8601)
* `Thursday 1 October 2026 17:10:17`

For week, a popup will allow choosing one of:
* `40-2026` (ISO week number and year)
* `w40-2026` (ISO week number and year)

## Custom completions

In the script settings dialog, you can add your own completions. For example:
```
app qownnotes
```
Then `\app` can be completed to `qownnotes`. Multiple completions can be given as space separated words. If a completion must embed spaces you can enclose it with `""`, for example:
```
thisapp qownnotes "QOwnNotes 26.9"
```
Case matters:
```
App qownnotes
```
Now `\App` will complete to `Qownnotes`. Yes, you see that good, if
the command starts with an uppercase letter the result will have its
first letter uppercased too.

### Placeholders

In the completions you can use a number of _placeholders_ to obtain substitutions for actual date and time values (table adapted from [QOwnNotes](https://www.qownnotes.org/scripting/methods-and-objects.html#formatting-dates-and-times):

| Placeholder | Meaning | Example |
| :----------- | :---------------------|:-------------- |
| `{yyyy}` | Year with four digits | 2026 |
| `{yy}` | Year with two digits | 26 |
| `{MM}` | Month with leading zero | 09 |
| `{M}` | Month without leading zero | 9 |
| `{MMM}` | Abbreviated localized month name | Sep |
| `{MMMM}` | Full localized month name | September |
| `{dd}` | Day with leading zero | 05 |
| `{d}` | Day without leading zero | 5 |
| `{ddd}` | Abbreviated localized day name | Tue |
| `{dddd}` | Full localized day name | Tuesday |
| `{HH}` | Hour (0-23) with leading zero | 07 |
| `{hh}` | Hour with leading zero (1-12 with AP) | 07 |
| `{mm}` | Minute with leading zero | 04 |
| `{ss}` | Second with leading zero | 09 |
| `{AP}` / `{ap}` | AM/PM or am/pm | AM |
| `{w}` | ISO week number without leadign zero | 5 |
| `{ww}` | ISO week number with leadign zero | 05 |
| `{LC:locale}` | Use the given locale | `{LC:nl_NL}`|
| `{+:offset}` | Offsets the date to the future | `{+:1D}` |
| `{-:offset}` | Offsets the date to the past | `{-:1D}` |

The date offsets may be a number of days, as shown above, or a number of milliseconds. `1D` is equivalent to `86400000`.

For example, the dutch version of tomorrows full date/time:

```
morgen "{lc:nl_NL}{+:1D}{dddd} {d} {MMMM} {yyyy} {hh}:{mm}:{ss}"
```
6 changes: 3 additions & 3 deletions quick-commands/info.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
"name": "Quick Commands",
"identifier": "quick-commands",
"script": "quick-commands.qml",
"authors": ["@LockeBirdsey"],
"authors": ["@LockeBirdsey","@sciurius"],
"platforms": ["linux", "macos", "windows"],
"version": "0.2.0",
"version": "0.3.0",
"minAppVersion": "25.4.1",
"description": "Short commands to help with repetive and/or annoying things to write frequently such as timestamps.\n\nEach command starts with a backslash (\\) and a single word for the command. Select the autocomplete option you desire and the command text will be replace.\n\nDefault commands are: today, tomorrow, yesterday, now, week.\n\nCustom commands can also be specified. Each line starts with the command name followed by one or more replacement values separated by spaces. Enclose multi-word values in double quotes, for example: myname \"Firstname Lastname\".",
"description": "Short commands to help with repetive and/or annoying things to write frequently such as timestamps.\n\nEach command starts with a backslash (\\) and a single word for the command. Select the autocomplete option you desire and the command text will be replace.\n\nDefault commands are: today, tomorrow, yesterday, now, week.\n\nCustom commands can also be specified. Each line starts with the command name followed by one or more replacement values separated by spaces. Enclose multi-word values in double quotes, for example: myname \"Firstname Lastname\". Date and time values can be substituted with {dd}, {MM} and so on.",
"resources": ["command-parser.js"]
}
Loading
Loading