Replies: 3 comments 5 replies
-
|
Great question, Script Kit is perfect for stuff like this: let file = home(`whatever.md`) //"home" is the same as `~/whatever.md`
let tab = await getActiveTab() //gets "url" from Chrome
// Creates or appends to file
await appendFile(
file,
`
[${tab}](${tab})`
)We can grab the title too, although I haven't written a helper for that yet, maybe I should 🤔: Install copy-tab-and-title-to-file let file = home(`whatever.md`) //"home" is the same as `~/whatever.md`
//returns a comma-delimited string: foo.com, Some title
let urlAndTitle = await applescript(
String.raw`tell application "Google Chrome" to return {URL, title} of active tab of front window`
)
let [url, title] = urlAndTitle.split(/, (.+)/) //split on first comma
// Creates or appends to file
await appendFile(
file,
`
[${title}](${url})`
) |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
thanks @johnlindquist ! I changed it to work with Brave! let file = home(`whatever.md`) //"home" is the same as `~/whatever.md`
//returns a comma-delimited string: foo.com, Some title
let urlAndTitle = await applescript(
String.raw`tell application "Brave" to return {URL, title} of active tab of front window`
)
let [url, title] = urlAndTitle.split(/, (.+)/) //split on first comma
// Creates or appends to file
await appendFile(
file,
`
- [${title}](${url})`
)thanks for the help!! |
Beta Was this translation helpful? Give feedback.
5 replies
-
|
A lot of interesting stuff to me, in here! Thanks!
Again, thank you! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm a big Foam user. I have a file called
inbox.mdwith a huge list of links I want to read. I know use a chrome extension that copies the focused page link in markdown format ([google](https://google.com)) so I can just open the file and paste there at the top of the list.I'm sure some of you'all have done something similar maybe? can someone point me to a similar example in which I can pass the link to a script and the script updates the file for me?
maybe this is a good start? https://www.scriptkit.com/johnlindquist/scripts/new-journal-entry
thanks!!
Beta Was this translation helpful? Give feedback.
All reactions