• 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: getting a file by URL ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: getting a file by URL ?


  • Subject: RE: getting a file by URL ?
  • From: Scott Babcock <email@hidden>
  • Date: Wed, 2 Jun 2010 04:05:11 +0000
  • Thread-topic: getting a file by URL ?

I handled a similar scenario with Python. I can't remember where I got the original code from. This handles all of the examples from this thread, although the TextWrangler example would need some additional processing to be usable.

on URLtoPOSIX(theURL)
	try
		set posixPath to (do shell script "python -c 'import urllib, urlparse, sys; print urllib.unquote(urlparse.urlparse(sys.argv[1])[2])' " & quoted form of theURL)
	on error
		set posixPath to ""
	end try

	return posixPath
end URLtoPOSIX

-----Original Message-----
Date: Tue, 01 Jun 2010 12:20:22 -0500
From: Luther Fuller <email@hidden>
Subject: Re: getting a file by URL ?
To: AppleScriptList <email@hidden>
Message-ID: <email@hidden>
Content-Type: text/plain; charset=iso-8859-1

On May 30, 2010, at 11:44 AM, Richard R?nnb?ck wrote:

> does anyone know a way to locate a file by URL, such as
>
> "file://localhost/Users/richardr/Desktop/bevakad/NORRSÄTRASKOLAN_mall_
> A4_2010/"
>
> and turn that into an alias/ posix file etc.

While trying to follow this topic (very interesting!), I realized that there is something I don't know and need to know: What is the source of the URL, above. What commands were used to get it?

 _______________________________________________
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: Changing QuickTime Recording Export Path
  • Next by Date: Re: getting a file by URL ?
  • Previous by thread: Re: getting a file by URL ?
  • Next by thread: QuickTime iSight Recording
  • Index(es):
    • Date
    • Thread