Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.os.linux.advocacy > #372999
| From | Snit <usenet@gallopinginsanity.com> |
|---|---|
| Newsgroups | comp.os.linux.advocacy |
| Subject | Re: Copy all URLs |
| Date | 2016-09-27 11:13 -0700 |
| Message-ID | <D41004DC.7E9BA%usenet@gallopinginsanity.com> (permalink) |
| References | <D40DD728.7E7B8%usenet@gallopinginsanity.com> <b67af9c2-5cd7-4eba-8195-97538254fc54@googlegroups.com> <fhjadu03.gi@perch.invalid> <2f0ca551-7804-4687-812f-0366030fdf81@googlegroups.com> <c14db800-e346-4c4f-84d0-3166aa73fd72@googlegroups.com> |
On 9/27/16, 11:00 AM, in article
c14db800-e346-4c4f-84d0-3166aa73fd72@googlegroups.com, "tmelmosfire"
<tmelmosfire@gmail.com> wrote:
...
>>> There is a "Copy all URLs" extension for chromium. You can also parse
>>> ~/.config/chromium/Default/"Current Session" for them. "Current Tabs"
>>> has old ones, oddly.
>>
>> I didn't write what I meant,
>
> Fucking shocking.
>
>> I should have said that I couldn't
>> find a way with javascript.
>
> Your new hammer?
>
>> In any event, given how he worded
>> the challenge, I expected to see an extension, not a script that
>> was turned into a service, like his shows.
>
> Snit noted that there was no extension so he was trying to find a way to
> script it. Your assumption is this means he was not trying to find a way to
> script it.
>
> Can you be any more lost with the English language, Steven Petruzzellis?
Yes, Carroll was a bit off but he had the basic idea... not going to nit
pick him for it. His solution was not as efficient as it could be but he
admits to not knowing AppleScript. No harm and I appreciate him focusing on
tech over trolling.
>> As I said, I've never
>> used Appescript before but it definitely can be useful if you're
>> doing these sorts of things.
>
> What the hell do you mean by these sorts of things? Things you could not even
> understand?
>
>> But I don't see any money in it so
>> I'll leave it at that.
>
> Steven Petruzzellis just admitted he is paid to harass and troll Snit.
OK, he does deserve that. :)
>> Being that he didn't specify formatting or
>> the getting of feedback (notifications) I didn't bother with any
>> of that; it looks like adding notifications would be easy enough.
>
> Yet you did not do it.
Nor was I specific with the challenge. I added it because my script can be
slow so I wanted to make sure I would not paste before it was done. It does
add a nice touch, but not needed.
>> While I fulfilled his challenge as worded, I give kudos to him
>> for the addition of the helper method (which eliminates the
>> loop altogether):
>>
>> - --
>> tell application "Safari"
>> set urlObj to (URL of every tab of window 1)
>> end tell
>> set the clipboard to urlObj as text
>> set AppleScript's text item delimiters to "\n"
>> - --
Need to set the delimiter before you use it... but that pretty much works.
Also, the AppleScript editor converts the \n to an actual new line making it
harder to read... it is more clear if you use the word return. I updated my
script to this:
--------
on run
tell application "Safari"
set AppleScript's text item delimiters to return
set theURLs to (URL of every tab of window 1)
end tell
set the clipboard to theURLs as text
display notification "Copied: " & (count of theURLs) & " URLs." as text
end run
---------
I tend to use the delimiters in AppleScript less than I "should," or at the
very least my using them more would make my scripts more concise and
sometimes faster.
> Are you calling a bunch of URLs a URL object? That seems stupid.
Well, it is an object (a list) containing URLs. Nothing wrong with the name.
>> I think he's crazy for not learning javascript, there are reasons
>> Apple is including it.
>
> Apple is not in charge of javascript.
Nor is that the implication he is making. JavaScript is more universal than
AppleScript.
...
--
* OS X / Linux: What is a file? <http://youtu.be/_dMbXGLW9PI>
* Mint MATE Trash, Panel, Menu: <http://youtu.be/C0y74FIf7uE>
* Mint KDE working with folders: <http://youtu.be/7C9nvniOoE0>
* Mint KDE creating files: <http://youtu.be/N7-fZJaJUv8>
* Mint KDE help: <http://youtu.be/3ikizUd3sa8>
* Mint KDE general navigation: <http://youtu.be/t9y14yZtQuI>
* Mint KDE bugs or Easter eggs? <http://youtu.be/CU-whJQvtfA>
* Easy on OS X / Hard on Linux: <http://youtu.be/D3BPWANQoIk>
* OS / Word Processor Comparison: <http://youtu.be/w6Qcl-w7s5c>
Back to comp.os.linux.advocacy | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: Copy all URLs Steve Carroll <fretwizzer@gmail.com> - 2016-09-26 14:18 -0700
Re: Copy all URLs Silver Slimer <.m@nsn.s> - 2016-09-26 17:21 -0400
Re: Copy all URLs Steve Carroll <fretwizzer@gmail.com> - 2016-09-26 14:28 -0700
Re: Copy all URLs Silver Slimer <.m@nsn.s> - 2016-09-26 17:31 -0400
Re: Copy all URLs Snit <usenet@gallopinginsanity.com> - 2016-09-26 14:28 -0700
Re: Copy all URLs tmelmosfire <tmelmosfire@gmail.com> - 2016-09-26 14:33 -0700
Re: Copy all URLs "Octavian W. Lagrange" <olagrang@perch.invalid> - 2016-09-27 06:24 +0000
Re: Copy all URLs Snit <usenet@gallopinginsanity.com> - 2016-09-27 08:31 -0700
Re: Copy all URLs "Octavian W. Lagrange" <olagrang@perch.invalid> - 2016-09-27 18:07 +0000
Re: Copy all URLs Snit <usenet@gallopinginsanity.com> - 2016-09-27 11:38 -0700
Re: Copy all URLs "Octavian W. Lagrange" <olagrang@perch.invalid> - 2016-09-27 19:56 +0000
Re: Copy all URLs Snit <usenet@gallopinginsanity.com> - 2016-09-27 13:23 -0700
Re: Copy all URLs Steve Carroll <fretwizzer@gmail.com> - 2016-09-27 08:54 -0700
Re: Copy all URLs tmelmosfire <tmelmosfire@gmail.com> - 2016-09-27 11:00 -0700
Re: Copy all URLs Snit <usenet@gallopinginsanity.com> - 2016-09-27 11:13 -0700
Re: Copy all URLs Steve Carroll <fretwizzer@gmail.com> - 2016-09-27 12:14 -0700
Re: Copy all URLs "Octavian W. Lagrange" <olagrang@perch.invalid> - 2016-09-27 19:28 +0000
Re: Copy all URLs Steve Carroll <fretwizzer@gmail.com> - 2016-09-27 12:44 -0700
Re: Copy all URLs Snit <usenet@gallopinginsanity.com> - 2016-09-27 12:46 -0700
Re: Copy all URLs "Octavian W. Lagrange" <olagrang@perch.invalid> - 2016-09-27 20:21 +0000
Re: Copy all URLs Snit <usenet@gallopinginsanity.com> - 2016-09-27 13:27 -0700
Re: Copy all URLs "Octavian W. Lagrange" <olagrang@perch.invalid> - 2016-09-27 21:58 +0000
Re: Copy all URLs "Octavian W. Lagrange" <olagrang@perch.invalid> - 2016-09-27 23:43 +0000
Re: Copy all URLs "Octavian W. Lagrange" <olagrang@perch.invalid> - 2016-09-28 01:16 +0000
Re: Copy all URLs "Octavian W. Lagrange" <olagrang@perch.invalid> - 2016-09-28 01:51 +0000
Re: Copy all URLs "Octavian W. Lagrange" <olagrang@perch.invalid> - 2016-09-28 02:33 +0000
Re: Copy all URLs "Octavian W. Lagrange" <olagrang@perch.invalid> - 2016-09-28 04:06 +0000
Re: Copy all URLs "Octavian W. Lagrange" <olagrang@perch.invalid> - 2016-09-28 06:19 +0000
Re: Copy all URLs Marek Novotny <marek.novotny@marspolar.com> - 2016-09-28 14:03 +0000
Re: Copy all URLs Steve Carroll <fretwizzer@gmail.com> - 2016-09-28 09:09 -0700
Re: Copy all URLs "Octavian W. Lagrange" <olagrang@perch.invalid> - 2016-09-28 04:13 +0000
Re: Copy all URLs Jim Polaski <jpolaski@linuxmail.org> - 2016-09-28 13:30 +0000
Re: Copy all URLs Snit <usenet@gallopinginsanity.com> - 2016-09-28 08:35 -0700
Re: Copy all URLs Steve Carroll <fretwizzer@gmail.com> - 2016-09-28 10:03 -0700
Re: Copy all URLs "Octavian W. Lagrange" <olagrang@perch.invalid> - 2016-09-27 21:59 +0000
Re: Copy all URLs tmelmosfire <tmelmosfire@gmail.com> - 2016-09-27 12:38 -0700
Re: Copy all URLs Snit <usenet@gallopinginsanity.com> - 2016-09-27 13:13 -0700
Re: Copy all URLs Steve Carroll <fretwizzer@gmail.com> - 2016-09-27 14:27 -0700
csiph-web