kit
kit copied to clipboard
How do I grant access to the filesystem on MacOS?
Error: EISDIR: illegal operation on a directory, read
How do I grant access to files and folders on Macos?
On a new install, this fails await ensureFile(home("foo.md"));
Usually when a program (e.x. terminal) attempts to access a new folder, I get a notification - but I don't see anything show up in kit.
Kit 1.40.62 Electron 22.0.0 darwin 21.6.0 Locale: en-US
In the system preferences, it should be under "Security and Privacy"

@johnlindquist - I tried to give full access but still get the access denied error message.
Also, I would expect to get a notification from the OS asking me to grant access, but nothing ever popped up.
(and since I gave full access, it appears there is no way to revoke full access 😨 - the option to select is disabled ) EDIT: Looks like I enabled under "Full Disk Access", which was why it was disabled in files and folders

I revoked access and now it looks like it is working - Kit does not show up in files and folders and is unselected in full disk access... 🤷
Hmm.... Actually, it looks like the error happens when playwright times out. That error message seems odd, maybe a log is trying to be saved somewhere without access?
This is the log entry accompanied by the error message popup window. This wondow shows on ALL errors of any kind, so I guess I was misled by the error message in the window.

[2023-01-19 18:53:03.235] [warn] ☠️ ERROR PROMPT SHOULD SHOW ☠️
[2023-01-19 18:53:03.236] [warn] page.waitForSelector: Timeout 10000ms exceeded.
=========================== logs ===========================
waiting for locator('.search-title') to be visible
============================================================
at global.scrapeSelector (file:///Users/foo/.kit/lib/browser.js:107:16)
at async file:///Users/foo/.kenv/scripts/firearm-scraper.js:5:15
[2023-01-19 18:53:03.248] [info]
$ cd /Users/foo/.kit
@paustint Are you on Discord? Might be easier to chat through it:
https://discord.gg/3xdhG5fyJM
Script Kit does try to write an error file to ~/.kenv/tmp/name-of-your-script/error-the-date.txt...
Does this script work for you?
// Name: Scrape ESPN
import "@johnlindquist/kit"
let results = await scrapeSelector(`https://games.crossfit.com/leaderboard/games/2021?division=1&sort=0`, ".name")
dev(results)