Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ossia-max] trouble writing and reading cue files with ossia.cue #823

Open
evanmtp opened this issue Feb 8, 2023 · 4 comments
Open

[ossia-max] trouble writing and reading cue files with ossia.cue #823

evanmtp opened this issue Feb 8, 2023 · 4 comments
Assignees

Comments

@evanmtp
Copy link
Contributor

evanmtp commented Feb 8, 2023

Currently the most pressing issue I'm facing is that it seems to not be possible to read files into ossia.cue. In the attached patch, sending the "read" message opens a dialog box that prompts you to save a file rather than opening one. This can be tested using the attached cue file (cues.json) which was generated via a write message to ossia.cue.

Yesterday while testing, I was able to read a json file that I had written via a write message to ossia.cue. I got an error complaining about malformed JSON. Unfortunately I'm not able to reproduce it at the moment.

Also worth mentioning - currently it seems like the "write path/to/file.txt" message doesn't work with relative paths, e.g. "write ~/Desktop/cues.json".

ossia.cue_write_read_bug.zip

@jcelerier
Copy link
Member

Also worth mentioning - currently it seems like the "write path/to/file.txt" message doesn't work with relative paths, e.g. "write ~/Desktop/cues.json".

this should be fixed, but note that " /Desktop/cues.json" is actually an absolute path, equivalent to "/Users/foo/Desktop/cues.json" - the reason it didn't work is because converting "" in "/Users/foo" is done by the shell (bash, zsh etc), from actual programming languages this has to be implemented by hand (which i did).

@evanmtp
Copy link
Contributor Author

evanmtp commented Feb 9, 2023

Just tested on macOS 10.14.6, using ossia version 331f9b4 (the build you sent via WeTransfer last night. When sending a write message, the dialog box now correctly shows Open rather than Save. Opening .txt files works fine, and presets are recalled correctly.

One ongoing issue is that the Open dialog box doesn't allow you to select files with the extension .json or .cue (though it does allow selection of .txt and .xml). This seems a bit weird because when you send the write message, the default filename in the Save dialog box is cues**.cue**.

Screen Shot 2023-02-09 at 1 28 00 PM

@evanmtp
Copy link
Contributor Author

evanmtp commented Feb 9, 2023

this should be fixed, but note that " /Desktop/cues.json" is actually an absolute path, equivalent to "/Users/foo/Desktop/cues.json" - the reason it didn't work is because converting "" in "/Users/foo" is done by the shell (bash, zsh etc), from actual programming languages this has to be implemented by hand (which i did).

Got it, thanks. I verified just now that paths using ~, i.e. read ~/Desktop/cues.txt, work. Paths using . and .. (i.e. read ./cues.txt, read ../cues.txt) seem to not, however. This isn't a priority for anything I'm doing at the moment, but seems like a nice-to-have.

@jcelerier
Copy link
Member

ah yes, those are also shell things... let me implement it. It shold work with "plain" relative paths though, e.g. read path/to/cues.txt and use the path to the patcher as root reference

For allowing any custom filenames I don't know how to do it... the max api seems to only allow "text" files? i'll investigate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants