• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: URL Encoding
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: URL Encoding


  • Subject: Re: URL Encoding
  • From: Andy Wylie <email@hidden>
  • Date: Sat, 06 Apr 2002 02:01:15 +1200

on 6/4/02 12:01 AM, has at email@hidden wrote:

> tell application "tanaka server" to MTEncodeURL(someURL)
>
>
> Probably going to be fairly slow,
>
--fast...

script tidMachine
property tidResult : ""
on tidStr(myStr, findStr, replaceWith, previousState)
set AppleScript's text item delimiters to findStr
set x to (myStr's text items)
set AppleScript's text item delimiters to replaceWith
set tidResult to x as string
set AppleScript's text item delimiters to previousState
end tidStr
on pathToURL(myStr)
{tidStr(myStr, ":", "/", ""), tidStr(tidResult, " ", " ", "")}
return "file:///" & (tidResult)
end pathToURL
on URLTopath(myStr)
{tidStr(myStr, " ", " ", ""), tidStr(tidResult, "/", ":", ""),
tidStr(tidResult, "file:///", "", "")}
return (tidResult)
end URLTopath
end script

set myStr to (choose file) as string
tell tidMachine to set myURL to pathToURL(myStr)
-- "file:///kevin/Desktop Folder/Calendar"
tell tidMachine to set filePath to URLTopath(myStr)
-- "kevin:Desktop Folder:Calendar"
>
> What other cool grooviness will it introduce?)
>
cool grooviness = hot smoothness I hope.

_____________________________ Andy
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: OSAX & X (From: has <email@hidden>)

  • Prev by Date: Re: URL Encoding
  • Next by Date: Re: URL Encoding
  • Previous by thread: Re: OSAX & X
  • Next by thread: Re: OSAX & X
  • Index(es):
    • Date
    • Thread