Kylmakalle / apple-reminders-exporter

Export Apple Reminders to JSON on macOS, using Shortcuts.app
1 stars 0 forks source link

Error during passing input to shortcut script #1

Closed ChenhuaWANG22 closed 1 week ago

ChenhuaWANG22 commented 1 week ago

I get below error message:

mkdir -p reminders
shortcuts run "Export Reminders" -i ./reminders
Error: Error Domain=NSCocoaErrorDomain Code=256 "The file “reminders” couldn’t be opened." UserInfo={NSFilePath=/Users/buchuo001/apple-reminders-exporter/reminders, NSUnderlyingError=0x6000037b0270 {Error Domain=NSPOSIXErrorDomain Code=21 "Is a directory"}}
make: *** [save] Error 1

In "shortcut-1.png", it's "Receive Folders input from Nowhere. If there's no input Ask For Files". It seems that shortcuts.app doesn't receive input "./reminders" correctly.

shortcut-1

I am not familiar with neither shortcuts nor makefile, so have no idea about how to fix this.

While, I find below workaround:

  1. for shortcut, manually indicate output folder and run it: In shortcuts.app, change "Shortcut Input" to "apple-reminders-exporter/reminders" (manually indicate output folder). In shortcuts.app, run above edited "Export Reminders.shortcut". After running, in folder "apple-reminders-exporter/reminders" there are all the json files.
  2. manually run organize: In Makefile, change "all: save organize" to "all: organize". In terminal, run "make", so that Makefile will be run.
Kylmakalle commented 1 week ago

Hi, it works for me on Sonoma 14.5 and should work for you as well. Running manually or changing the input type from folder to just Text will fix it for you. In any case, it's not a big deal since you can have a personalized shortcut with your path. The only thing you will need is a modified Makefile, which is basically "shortcut for terminal commands"

all: save organize

.PHONY: save
save:
    shortcuts run "Export Reminders"

.PHONY: organize
organize: 
    python3 scripts/organize.py ./<your_directory>

.PHONY: clean
clean:
    rm -rf ./<your_directory>