Mathematica Asked on July 30, 2021
I built a new word bank of many words myself. I hope that every time I open this notebook nb
file, this cell can run automatically, so that I can automatically assign a value to newwords
, and then automatically make cursor jump to the cell of the query content.
newwords={"abate", "abbreviate", "aberrant", "ability pump", "abound",
"abrade", "abrogate", "abscess", "abstain", "abstinence", "abstruse",
"abut", "academician", "accede", "accessory", "accommodate",
"accordion", "accredit", "accreditation", "acid", "hyper",
"acidosis", "acne", "acquaint", "acquisitive", "acrophobia",
"acropolis", "acumen", "acupuncture", "adamant", "adduce", "adept",
"adjunct", "admonish", "admonition", "adobe", "adolescence", "adore",
"adorn", "adulterate", "advent", "adversity", "adz", "aerobic",
"aesthetic", "afferent", "affiliate", "affinity", "affluent",
"afterlife", "ageism", "agile","..."};
SelectionMove[EvaluationCell[], Next, CellContents, 3(*跳转次数*)]
Select[newwords,
StringMatchQ[#,
"obli" ~~ __] &](*After executing the cell above, I want to jump
to this cell automatically (this cell does not need to run
automatically)*)
I want to achieve this function by modifying the cell expression of the cell where newwords
is located, but how can I do this?
Assuming they are consecutive cells you can do:
(*make sure this cell does not produce output because then NextCell is the output cell*)
newwords = {...};
selectCell = NextCell[];
SelectionMove[selectCell, Before, CellContents];
NotebookFind[EvaluationNotebook[], """, Next, CellContents];
SelectionMove[EvaluationNotebook[], After, Character];
Select[newwords, StringMatchQ[#, "obli" ~~ __] &]
Seems to do what you need.
Side note, consider Iconize
for newwords
or even move them to a separate .m file and Get
it.
Correct answer by Kuba on July 30, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP