• 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: Trouble escaping @
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Trouble escaping @


  • Subject: Re: Trouble escaping @
  • From: "Nigel Garvey" <email@hidden>
  • Date: Mon, 11 Dec 2017 21:40:25 +0000

"Jacopille, David" wrote on Thu, 7 Dec 2017 17:08:17 +0000:

>I’m trying to automatically mount a webdav share but am having
difficulty
>escaping a @ in the password.
>
>property username : "superuser"
>property pass : "Bl@ckberry"
>
>tell application "Finder"
>mount volume "http://"; & username & ":" & pass &
>"@servername:5100/content/dam"
>end tell
>
>I get the error: there was a problem connection to the server
>ckberry@servername.

I think you possibly need to percent-encode the "@" in the password:
"Bl@ckberry". You can either write it like that in the script, or get
the script to encode it for you:

  use AppleScript version "2.4" -- Yosemite (10.10) or later
  use framework "Foundation"

  property username : "superuser"
  property pass : "Bl@ckberry"

  set myPassword to current application's class "NSString"'s
stringWithString:(pass)
  set passwordAllowedCharacters to current application's class
"NSCharacterSet"'s URLPasswordAllowedCharacterSet()
  set encodedPassword to myPassword's
stringByAddingPercentEncodingWithAllowedCharacters:(passwordAllowedCharacters)

  mount volume ("http://"; & username & ":" & encodedPassword &
"@servername:5100/content/dam")


NG
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Prev by Date: Re: Is there a way to prepare NSAttaributedString like "attribute runs"?
  • Next by Date: Re: Is there a way to prepare NSAttaributedString like "attribute runs"?
  • Previous by thread: Trouble escaping @
  • Next by thread: Re: How to script the launching of a script at a specific time...
  • Index(es):
    • Date
    • Thread