piroor / copy-selected-tabs-to-clipboard

Provides ability to copy title and URL of selected tabs to the clipboard for Firefox 63 and later.
Other
83 stars 16 forks source link

Wanting to replace the whole URL with a few potential things #20

Open Etrit1 opened 3 years ago

Etrit1 commented 3 years ago

Piro, I LOVE TST so much! thank you for making it.!

As for Copy Tabs, I'm seeing so much potential for using it to make my dream of using Mindmaps for Bookrmark organization a thing.

I'm wondering if it's possible to do any of the following while using Markdown(list) format.

1) Have a format that copies the Page title and attaches a URL Link to that page title with no other text copied. ---I'm guessing that's probably impossible.

or

2) Copies the Page Title and replaces the URL txt with "Link" (or whatever) but, that "Link" contains the URL...

Ergo, I guess both of these would be having the addon do the whole URL Text vrs URL address stuff.

Thanks! :-)

Also, is there any way we can donate to you? I can't find any way on any of your websites or on Firefox addons pages. (And now that I'm thinking about it, Firefox REALLY needs a donate button on the addons pages. You devs are friggen amazing!)

piroor commented 3 years ago

Sorry I couldn't understand what is the desired behavior. Could you describe with an example (real) URL and the expected result?

And sorry there is no donation way about my addons. I wrote my thought about that here: https://github.com/piroor/treestyletab#other-topics

Etrit1 commented 3 years ago

Oooh to the reason why you don't want donations. I totally understand. :-)

So, thank you a million times for making TST! It's seriously the best addon for Firefox and the only reason why I'm not on Chrome right now. (since Mozilla totally ruined Firefox for Android... ugh!) I can not live without TST and all the similar addons for Chrome are trash.

As for my thing with Copy_selected_tabs. I don't know if part of it is possible but here we go:

I guess I want to be able to have some HTML code inserted into the copy result, and strip out some text.

Lets use this webpage as an example:

https://www.goodnewsnetwork.org/education-bangladesh-garment-workers-pathways-for-promise/

The page title is: Garment Workers Are Now Being Educated in Bangladesh So They Can Go to College

CST gives you this in the clipboard when you use Markdown(List)

* [Garment Workers Are Now Being Educated in Bangladesh So They Can Go to College](https://www.goodnewsnetwork.org/education-bangladesh-garment-workers-pathways-for-promise/ https://www.goodnewsnetwork.org/education-bangladesh-garment-workers-pathways-for-promise/ "Garment Workers Are Now Being Educated in Bangladesh So They Can Go to College")

I'd like to have CST do the following:

Copy the page title, %Replace everything currently within the ( ) with the word "Link" (or anything else really) which is really HTML code for the whole "Text to Display"(in relation to an inserted link) instead of showing the URL itself. Like what Gmail lets you do when you insert a link or when webpages just have words within the body of text that are also links to other webpages.

IE, the result when you pasted the copied tab(s) into Word or something that can handle HTML would be this:

Garment Workers Are Now Being Educated in Bangladesh So They Can Go to College (Link) https://www.goodnewsnetwork.org/education-bangladesh-garment-workers-pathways-for-promise/

The HTML behind that:

Garment Workers Are Now Being Educated in Bangladesh So They Can Go to College (Link)

Or ideally really, be able to use the page title as the "Text to Display" in relation to the URL so we get this:

Garment Workers Are Now Being Educated in Bangladesh So They Can Go to College https://www.goodnewsnetwork.org/education-bangladesh-garment-workers-pathways-for-promise/

HTML behind that: Garment Workers Are Now Being Educated in Bangladesh So They Can Go to College

I'm kinda thinking those might be a bit too much for CST to handle though, so if it is, it would be nice to at least just strip off the repeat of the page title at the end of the copy result. By this I mean, get rid of anything within the " " at the end of the copy result, including the " "

So you'd get this instead in the clipboard:

Garment Workers Are Now Being Educated in Bangladesh So They Can Go to College ( https://www.goodnewsnetwork.org/education-bangladesh-garment-workers-pathways-for-promise)

Thanks for making all these great addons and taking time to talk to me about my idea! :-) Please let me know if you need any more info about what I'm talking about.

On Mon, Feb 8, 2021 at 12:19 AM piroor notifications@github.com wrote:

Sorry I couldn't understand what is the desired behavior. Could you describe with an example (real) URL and the expected result?

And sorry there is no donation way about my addons. I wrote my thought about that here: https://github.com/piroor/treestyletab#other-topics

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/piroor/copy-selected-tabs-to-clipboard/issues/20#issuecomment-774961853, or unsubscribe https://github.com/notifications/unsubscribe-auth/AG34OYQG5KSUSERDEN4ZXT3S56NB5ANCNFSM4XGRQBAQ .

piroor commented 3 years ago

Hmm... sorry I'm still confused. Examples you wrote look to be covered with existing placeholders for me.

The HTML behind that:

Garment Workers Are Now Being Educated in Bangladesh So They Can Go to College (Link)

It looks to be produced with a format:

%RT%%TITLE% (<a href="%URL_HTML%">Link</a>)

HTML behind that: Garment Workers Are Now Being Educated in Bangladesh So They Can Go to College

It looks to be produced with:

%RT%<a href="%URL_HTML%">%TITLE_HTML%</a>

Please note that you need to do two things to activate the %RT% (rich text) feature: grant an extra permission to the CST, and change Firefox's secret option dom.events.asyncClipboard.dataTransfer to true via about:config.

Etrit1 commented 3 years ago

Oooh! You totally hit the nail on the head with both of those! :-) Thanks so much! I was trying to do it with %replace% instead of %RT%

That being said, I can't get either to work with %TST_INDENT(indenter)%.

I've tried many different things, but nothing works. It looks like %RT% doesn't play well with %TST_INDENT()% ---I've spent over 30mins trying so many combos of things but no luck.

or, there is some trick to making it work that I just can't figure out. Which, totally wouldn't surprise me heh.

Thanks again for your help.

On Mon, Feb 8, 2021 at 6:45 PM piroor notifications@github.com wrote:

Hmm... sorry I'm still confused. Examples you wrote look to be covered with existing placeholders for me.

The HTML behind that:

Garment Workers Are Now Being Educated in Bangladesh So They Can Go to College (Link)

It looks to be produced with a format:

%RT%%TITLE% (Link)

HTML behind that: Garment Workers Are Now Being Educated in Bangladesh So They Can Go to College

It looks to be produced with:

%RT%%TITLE_HTML%

Please note that you need to do two things to activate the %RT% (rich text) feature: grant an extra permission to the CST, and change Firefox's secret option dom.events.asyncClipboard.dataTransfer to true via about:config.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/piroor/copy-selected-tabs-to-clipboard/issues/20#issuecomment-775616026, or unsubscribe https://github.com/notifications/unsubscribe-auth/AG34OYS6MVB632FDVNX2NOLS6COVHANCNFSM4XGRQBAQ .

piroor commented 3 years ago

%TST_INDENT()% affects only when highlighted multiple tabs construct a valid tree structure. For example, assume that you have these tabs:

and assume that you use a format %TST_INDENT(-)%> %TITLE%.

When A, C and D are highlighted, they are treated as a valid tree. The copied text will be:

-> A
--> C
---> D

On the other hand, when B and C are highlighted, there is no difference between their indent level so %TST_INDENT()% will become a blank text, like:

> B
> C

When A and D are highlighted, they have gaped indent levels so they are not treated as a tree, so they are also copied as flat tabs like as:

> A
> D

Please note that you need to put a list bullet outside of the %TST_INDENT()% if you hope to the bullet always to be copied.

Etrit1 commented 3 years ago

Heya Piro,

I understand that TST_INDENT()% Needs a valid tab structure.

I've done a bit more trouble shooting. What seems to be happening is that any program that recognizes Rich Text Formatting is removing the spaces or %TAB% or %EOL% when used as the identifier in TST_INDENT()

I'm sadly not sure you can actually fix the issue. Well, unless there is a way you can make %RT% be an opening and closing thing like the HTML so only part of the Copy Tabs format being considered Rich Text.

This is what I'm seeing:

Using the %TITLE_HTML% format makes for a lot of screen clutter so I didn't pick that format for my below examples. But, of course, you need to put %RT% in the format to make a clickable link.

My Tab structure:

[image: OpenTabs.png]

Using Copy Tabs with: %TST_INDENT( )%* %TITLE%

Pasted into Notepad on Windows

Pasted into MS Word

Both look fine, but then lets do *%RT%*: %TST_INDENT( )%* %RT% %TITLE%

Pasted into Notepad

Still looks great.

Here's that filter pasted into MS Word:

And.... broken.

Interestingly enough, this is what happens in Word with: %TST_INDENT(>>)%* %RT% %TITLE%

TST_INDENT() works correctly, just with a bunch of annoying >. So, that's why I came up with programs that understand RT formatting not playing well with the space as an identifier for TST_INDENT(). This means you could use: %TITLE_HTML% and get a clickable link.

Users of course could run a Find&Replace to delete all the >> if we are in a program that has that function. But, that is pretty annoying.

I've also played with %EOL% and %TAB% as identifiers and no joy in Word if you use %RT%

Results with: %TST_INDENT(%TAB%)% *%TITLE%

*Google News

           *Auto Tab Discard :: add0n.com

           *Blackouts Hit 13 States Beyond Texas in Deepening Power

Crisis - Bloomberg

                        *Contact menu | Bloomberg Professional Services

                                      *Contact menu | Bloomberg

Professional Services

           *Pfizer vaccine reduces symptomatic COVID-19 cases by 94%:

Israel study

Results using %RT%: %TST_INDENT(%TAB%)% * %RT% %TITLE%

...and TST_INDENT() is broken again.

Also, I'm actually pasting into the program Freeplane which is a mind mapping software and the >> sadly doesn't fix the issue.

Here's some examples:

Using: %TST_INDENT( )%* %TITLE%

[image: no RT.png]

Adding %RT% for this: %TST_INDENT( )%* %RT% %TITLE%

[image: rt SPACE.png] Using: %TST_INDENT(>>)%* %RT% %TITLE%:

[image: rt with .png]

Happily though, I found out that doing %TST_INDENT( )% %TITLE% %URL% works in FreePlane by giving me a little arrow/link on the nodes to click on:

[image: url&title.png] Having the URL in the node is pretty annoying, but I have to have Copy Tabs copy it or FreePlane won't know that there is a URL there. I'm also pretty sure that using %replace% in anyway will break it. But, it will work for me.

However, it just gives you this in MS Word:

Google News https://news.google.com/topstories?hl=en-US&gl=US&ceid=US:en

Auto Tab Discard :: add0n.com https://add0n.com/tab-discard.html?version=0.4.1&p=0.4.0&type=update

Blackouts Hit 13 States Beyond Texas in Deepening Power Crisis - Bloomberg https://www.bloomberg.com/news/articles/2021-02-15/u-s-southwest-grid-operator-orders-rolling-blackouts-amid-cold

 Contact menu | Bloomberg Professional Services

https://www.bloomberg.com/professional/contact-menu/?utm_source=bloomberg-menu&utm_medium=bcom&bbgsum=DG-WS-PROF-DEMO-bbgmenu

   Contact menu | Bloomberg Professional Services

https://www.bloomberg.com/professional/contact-menu/?utm_source=bloomberg-menu&utm_medium=bcom&bbgsum=DG-WS-PROF-DEMO-bbgmenu#

Pfizer vaccine reduces symptomatic COVID-19 cases by 94%: Israel study https://www.businessinsider.com/pfizer-vaccine-reduces-symptomatic-covid-19-cases-israel-2021-2

Like I said in the beginning, I'm not sure if there is anything you can actually do to fix the issue. It seems like it's probably on the programs that are being pasted into. Or, may if you could again make %RT% be an opening and closing thing like HTML and so only part of the Copy Tabs format is considered rich text. I just have no clue if that is possible.

I've also tried doing stuff like the following in a Copy Tabs format in the TST_IDENTIFIER() but, no joy:

^l === line break

^v === paragraph

etc etc I get is those characters repeated if I put them in the ( ) while using %RT%. They WILL work without the %RT% though.

I'm ok with the workaround I found for Freeplane, but I was thinking it would be cool for other users AND You if I / we could figure out a way to make %RT% and %TST_INDENT()% play well together in programs. (and of course cool for me also hehe :-)

It would be great to be able to paste it into an Outlining program or even Word etc etc and just have the page Title be a link using <a href="%URL_HTML%">%TITLE_HTML%

Thanks again for your time working on this issue with me AND for making TST and TST_Copy! :-) I totes understand why you don't want to take donations but ugh, I so wish I could buy you a beer or coffee heh. :-)

piroor commented 3 years ago

Attached images looks to be missing on this issue tracker webpage and the notification mail delivered to me. Could you attach them again via the Web interface https://github.com/piroor/copy-selected-tabs-to-clipboard/issues/20 ?