I was but found another error. I missed the option to copy to “save results to clipboard.” Duh! But now the script is giving an error.
script error: Expected expression but found “/”. (-2741)
which means little to me. Particularly since many slashes appear.
I tried the Ruby script, but got this error
/var/folders/y1/2kz16x1n4zd46lwwyss_g_4m0000gn/T/Keyboard-Maestro-Script-D26E2094-6428-4661-A10D-4704D670360C:6:in `match': invalid byte sequence in US-ASCII (ArgumentError)
from /var/folders/y1/2kz16x1n4zd46lwwyss_g_4m0000gn/T/Keyboard-Maestro-Script-D26E2094-6428-4661-A10D-4704D670360C:6:in `match'
from /var/folders/y1/2kz16x1n4zd46lwwyss_g_4m0000gn/T/Keyboard-Maestro-Script-D26E2094-6428-4661-A10D-4704D670360C:6:in `block in <main>'
from /var/folders/y1/2kz16x1n4zd46lwwyss_g_4m0000gn/T/Keyboard-Maestro-Script-D26E2094-6428-4661-A10D-4704D670360C:3:in `loop'
from /var/folders/y1/2kz16x1n4zd46lwwyss_g_4m0000gn/T/Keyboard-Maestro-Script-D26E2094-6428-4661-A10D-4704D670360C:3:in `<main>'
Thank you for responding. I’m good at getting errors
“class AddDescriptionToLocations < ActiveRecord::Migration
def change
add_column :locations, :name, :string
add_column :locations, :description, :string
end
end”
Excerpt From: W. Jason Gilmore. “Easy Active Record for Rails Developers.” iBooks.
What is wanted is what’s between the first set of double quotes.
This solution doesn't work for me. Neither does this one (though it worked for a while).
When I copy in Apple Books, I get this:
“In fact, the performance of British riders had been so underwhelming that one of the top bike manufacturers in Europe refused to sell bikes to the team because they were afraid that it would hurt sales if other professionals saw the Brits using their gear.”
Excerpt From
Atomic Habits: Tiny Changes, Remarkable Results
James Clear
This material may be protected by copyright.
I'd like for the macro to be executed seamlessly—when I press Cmd+C in Books.
Chris's regex should work -- at least for the text you provided (it has problems if there are quotes within the copied text). The Paste action will fail if you run it with Books frontmost and the text you want selected, but you should still be able to switch to another app and Paste the cleaned text manually. Perhaps that was the problem?