Replies: 1 comment 1 reply
-
Hi, this is actually a built-in function, try pressing I'm not sure what's the problem in your script but this one is working: api.addButtonToToolbar({
title: 'addTimeStamp',
icon: 'check',
shortcut: 'ctrl+g',
action: async function() {
await api.addTextToActiveTabEditor(new Date().getHours()+":"+new Date().getMinutes()+" ");
}
}); |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello, i wanna insert a time stamp text after the cursor, but i get failed. What's wrong with it?
api.addButtonToToolbar({ title: 'addTimeStamp', icon: 'check', shortcut: 'ctrl+g', action: async function() { await api.addTextToActiveTabEditor(new Date().getHours()+":"+new Date().getMinutes()+" "); await api.waitUntilSynced() } });
In fact, i can't find the function's definition(addTextToActiveTabEditor(text)) in following files, which i thought perhaps related to:
Beta Was this translation helpful? Give feedback.
All reactions