• 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: encode url without OSAX
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: encode url without OSAX


  • Subject: Re: encode url without OSAX
  • From: Paul Berkowitz <email@hidden>
  • Date: Fri, 29 Jun 2001 20:44:04 -0700

On 6/29/01 8:12 PM, "Brian" <email@hidden> wrote:

> trying to script an http upload script I ran into a need to encode
> characters for use in a url and I quickly located the "Encode URL" OSAX,
but
> wanted to try to avoid scripting additions if at all possible.
>
> I thought I might be able to do something like:
>
> set x to "the quick brown fox"
> set y to every text item of x
> repeat with i in y
> if i = " " then
> set i to " "
> end if
> end repeat
> return y as string
>
> but the result still shows the <spaces> as <spaces> rather than s.
>
> Any ideas what I'm missing/doing wrong/don't understand?
>
You're merely re-setting 'i', a variable, each time it's equal to " ".
You're not changing anything in the the list y. You want to do this :

set AppleScript's text item delimiters to {""} -- make sure
set x to "the quick brown fox"
set y to every character of x
repeat with i from 1 to (count y)
if item i of y = " " then
set item i of y to " "
end if
end repeat
return y as text

--
Paul Berkowitz


References: 
 >encode url without OSAX (From: Brian <email@hidden>)

  • Prev by Date: encode url without OSAX
  • Next by Date: Re: load script question
  • Previous by thread: encode url without OSAX
  • Next by thread: Re: encode url without OSAX
  • Index(es):
    • Date
    • Thread