Fixed a some bugs in active/inactive window state tracking
Fixed case where right click on link button would not select link
Fixed case where pasting a link over selection would not add link
The new rich text property “text content” of row should make working with rich text attributes a lot easier. For example you can now:
tell front document of application "Bike"
tell first row
set bold of first word of text content to true
end tell
end tell
tell front document of application "Bike"
tell first row
repeat with eachRun in attribute runs of text content
set modelLink to link of eachRun
log modelLink
set viewLink to view link of eachRun
log viewLink
end repeat
end tell
end tell
To get preview releases through Bike’s software update select: Bike > Preferences > General > Include “preview” releases.
As always, using Bike heavily and appreciate so much about it
I noticed that “select all below cursor” (Cmd + Shift + Down) causes the document to scroll to the top, the same behavior as “select all above cursor” (Cmd + Shift + Up). The text is correctly selected, but usually jumps suddenly out of view. Not a frequent action for me, but jarring when I’m expecting it to scroll to the bottom instead!
(() => {
"use strict";
// ----- FIRST WORD OF FIRST ROW FORMATTED BOLD ------
Application("Bike")
.documents.at(0)
.rows.at(0)
.textContent.words.at(0)
.bold = true;
})();
(() => {
"use strict";
// ----- ALL LINKS IN FRONT DOCUMENT, SORTED A-Z -----
const
runs = Application("Bike").documents.at(0)
.rows.textContent.attributeRuns;
console.log(
[...runs.link(), ...runs.viewLink()]
.flat()
.filter(Boolean)
.sort()
.join("\n")
);
})();
Or, FWIW, a variant preserving the order of links in the document:
(() => {
"use strict";
// -- ALL LINKS IN FRONT DOCUMENT, PRESERVING ORDER --
const main = () => {
const
runs = Application("Bike").documents.at(0)
.rows.textContent.attributeRuns;
return console.log(
Array.from(
new Set(
zipWith(
a => b => a || b
)(
runs.link()
)(
runs.viewLink()
)
.flat()
.filter(Boolean)
)
)
.join("\n")
);
};
// --------------------- GENERIC ---------------------
// zipWith :: (a -> b -> c) -> [a] -> [b] -> [c]
const zipWith = f =>
// A list constructed by zipping with a
// custom function, rather than with the
// default tuple constructor.
xs => ys => xs.map(
(x, i) => f(x)(ys[i])
).slice(
0, Math.min(xs.length, ys.length)
);
// MAIN ---
return main();
})();
Good news is I’m always making these sorts of errors, so if they are now being noticed (and not bugs in Bike) it must mean Bike 1.4 is getting close to release.
I’ve been fixing some scrolling bugs this morning. After that I have one more bug on my list, (an issue with line affinity being messed up by link buttons that I think no one has reported yet).
Do let me know if anyone is seeing other problems that should hold back 1.4. Time’s getting close (though I still have to do documentation and make a video and such).