So please DT, can this google/utube consent spam be filtered out??
I note maybe it can, as this problem does not appear with other applications eg Bear… Yes, the title is spammed, but it at least takes you to the right utube video
(1) Can DT remove that pesky consent prefix like other apps (eg Bear)
Going further (icing on the cake)
**(2) Can DT have a built in youtube Ad block ? These Ads persist if I open the link internally within DT…
( In case its useful to others, a partial solution to (2)…
So IF I’m lucky not to have that pesky consent spam (see (1) above ), I open the link in Safari externally which then uses the adblock I got (“Dynamo” app) for player peace. )
This is untested, because I don’t have any files handy to test it on; it will only work if the first section of the URL is always https://consent.youtube.com/ml?continue= which I assume will be the case; otherwise you’d need to adjust the condition in the rule. The script will cut the URL at the first = so would work with any URL which needed to be cut at that point.
on performSmartRule(theRecords)
tell application id "DNtp"
repeat with theRecord in theRecords
set theURL to URL of theRecord
set thePos to offset of "=" in theURL
set thePos to thePos + 1
set theURL to texts thePos thru -1 of theURL
set URL of theRecord to theURL
end repeat
end tell
end performSmartRule
Once you have changed the URL of one of your bookmarks, you could try running the script called _Set Name To Title Of Web Page from the Script/Rename menu in DT. If that changes the title of your bookmark in the fashion you want, that script could easily be integrated into the little script I wrote, meaning you would get what you wanted with one simple smart rule
If that does work, then this should do the whole trick:
In my case, I don’t see those URLs when sharing, but the name is always “Before you continue to YouTube” for any bookmark.
So I tried making a smart rule and copied the code from _Set Name To Title Of Web Page.scpt into it, but it doesn’t work. I have no clue about scripting, could you tell me what I need to paste into the embedded script?
Primarily you should check to see whether if you select a file and then choose the Set Name To Title Of Web Page script from the menu your file is correctly renamed. If it is, I’ll show you how to integrate that script into a smart rule.
Not for me. It seems that recent YouTube changes completely ruined sharing YouTube URLs. This applies to most apps I tried. Apple Notes, Messages, …
There are no previews possible any longer in Messages for instance.
In Notes, it looks like this:
Given that these apps don’t have anything to do with your login details / cookies from the browser or the YouTube app, my guess is that this can only be fixed by YouTube.
This should work (tested once on a URL with an appropriate smart rule, worked):
-- Set name to title of web page
-- Created by Christian Grunenberg Mon Apr 26 2004.
-- Copyright (c) 2004-2019. All rights reserved.
-- adapted for Smart Rule by Blanc with kind permission
on performSmartRule(this_selection)
tell application id "DNtp"
try
set this_count to count of this_selection
if this_count > 0 then
show progress indicator "Renaming" steps this_count
repeat with this_item in this_selection
set this_type to the type of this_item
set this_source to missing value
step progress indicator (name of this_item) as string
if this_type is equal to html or this_type is equal to webarchive then
set this_source to source of this_item
else if this_type is equal to bookmark then
set this_URL to the URL of this_item
if this_URL is not "" then set this_source to download markup from this_URL
end if
if this_source is not missing value then
set this_title to get title of this_source
if this_title is not missing value and this_title is not "" then set the name of this_item to this_title
end if
end repeat
hide progress indicator
end if
on error error_message number error_number
hide progress indicator
if the error_number is not -128 then display alert "DEVONthink" message error_message as warning
end try
end tell
end performSmartRule
Pls post back whether the rule runs as it should. Cheers.
It’s the full URL but DEVONthink’s Inspector displays it in a way that one can think it’s cut. Select the URL field and move down via mouse or arrow key to see the whole URL.
@cgrunenberg Seeing both Inspectors side by side in @carl99’s post I wonder why DEVONthink wraps the URL and DEVONthink To Go doesn’t. Is this a macOS limitation?
In the Info inspector the URL field is automatically resized but in the Info popover that’s not the case but the URL field should probably be truncated not wrapped. Changed.