Friday, October 22, 2021

#1 2021-07-21 06:07:12 am

Registered: 2019-10-23
Posts: 901

Quick way to strip a Google URL to a flat URL

When we copy a Google URL we get more what we want.

This simple example show how we could remove it with plain Vanilla AppleScript.


-- Google string
set theString to ""

return its flatURLFromGoogleURL(theString, {"", "&"})

on flatURLFromGoogleURL(inputString, {theBeginString, theEndString})
   set theEndString to text (offset of theEndString in inputString) thru -1 of inputString
   set AppleScript's text item delimiters to {theBeginString, theEndString}
   set theResult to text items of inputString
   set text item delimiters to ""
   return theResult as text
end flatURLFromGoogleURL

if you are the expert, who will you call if its not your imagination.



Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)