Message Boards Message Boards

0
|
4852 Views
|
4 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Opening a Mathematica notebook in another folder using software

Posted 3 years ago

I am using a MacBook Pro, with OS Big Sur v. 11.3.1 and Mathematica 12.

I am attempting to move several HyperCard Stacks over to Mathematica. For an example of the sort of thing I'm trying to move please see -- https://luysii.wordpress.com/2021/09/24/6287/. Total stack size about 100 megaBytes.

I would like to write a function residing in one Mathematica notebook to open a new Mathematica notebook to be titled myString.nb in /User/myName/Desktop/Hypercard Xref

I realize that, to the cognoscenti, the problem is trivial, but finding out how to do some of the simplest things in Mathematica is difficult and the answers are far from intuitive. Example: Finding out how many elements are in a list doesn't involve any of the 14 Count* functions, but rather Length [ list ]. Example: Getting a number out of a string involves

StringCases["Total Number of Cards = 6", x : NumberString :> ToExpression[x]]

Any help will be greatly appreciated.

POSTED BY: Lewis Robinson
4 Replies
Posted 3 years ago

Thanks Rohit. I am totally unfamiliar with HTML and will check it out eventually. However the first order of business is to get the data over from an iMac G5 (no longer made, but which can still run Hypercard) to Mathematica. By data I mean 16K+ cards (you saw one of them), 22K index items 8 K glossary items, etc. etc. Once over into Mathematica I can look at HTML.

Even once over, I'll need to figure out a way to continue reading, updating the cards as I do so. Looking down the road, I think one of the largest problems will be searching the data for particular strings. Looking at 46 K individual files doesn't seem practical.

Again thanks, you have been quite helpful

LR

POSTED BY: Lewis Robinson
Posted 3 years ago
POSTED BY: Lewis Robinson
Posted 3 years ago

Hi Lewis,

Well what you get when you actually try to open a Mathematica notebook written in Mathematica 10 on the new machine is something like this

It should not look like that. Notebooks created in V5 of Mathematica open fine in V12. You may get prompted to convert the notebook to the current style. Edit your post and attach the notebook so we can reproduce the problem and try to identify why that is happening.

What exactly is your end goal? In a previous question you asked on the same topic I suggested that perhaps converting each card to an HTML document with hyperlinks to other HTML documents (cards) might be a better way to do this rather than converting them to notebooks. Did you consider that?

Converting all of the cards to HTML documents and linking them can be done with a Wolfram Language program.

POSTED BY: Rohit Namjoshi
Posted 3 years ago

Hi Lewis,

Here is one way

notebook = CreateNotebook[];
fileName = FileNameJoin[{"/User/myName/Desktop/Hypercard Xref", "myString.nb"}]
NotebookSave[notebook, fileName]

If you want to programmatically add content to the notebook take a look at this.

If the notebooks you want to create have a similar structure you can create a template notebook and populate it programmatically. See this.

POSTED BY: Rohit Namjoshi
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract