• 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: Script to save webloc
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Script to save webloc


  • Subject: Re: Script to save webloc
  • From: "Michael Grant" <email@hidden>
  • Date: Fri, 9 Jan 2009 09:34:09 -0600

On Fri, Jan 9, 2009 at 2:03 AM, Scott Haneda <email@hidden> wrote:
> So, right where I am making the new internet location file, I need to
> instead save a text file, as filename of dname & ".url" with the data in the
> file being:
> [InternetShortcut]
> URL=http://theurl.exampple.com

I think I mistakenly sent my solution to you directly instead of to
the list right after your original post, but it does work (and even
allows you to choose where to save the file and to give a filename of
your choice, unlike some of the other options). Of course you'll want
to edit the default path before using it on your own machine.

Michael


property bmFolder : ":Users:mgrant:Library:BDBookmarks:"

tell application "System Events" to set sd to name of startup disk

set bmFolder to alias (sd & bmFolder)
try
       tell application "Safari"
               activate
               set theURL to URL of (document of window 1)
               set theTitle to name of window 1

               set aFile to (choose file name with prompt "Save
bookmark:" default
name theTitle default location bmFolder)
               set pFile to (POSIX path of aFile) & ".url"
       end tell

       set res to "[InternetShortcut]
URL=" & theURL

       set cmd to "echo \"" & res & "\" > " & quoted form of pFile
       do shell script cmd
on error x
       activate me
       display dialog x
end try


--
You have to be happy with what you have to be happy with what you have
to be happy with.
 _______________________________________________
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

References: 
 >Script to save webloc (From: Scott Haneda <email@hidden>)
 >Re: Script to save webloc (From: Fuller Luther <email@hidden>)
 >Re: Script to save webloc (From: Scott Haneda <email@hidden>)
 >Re: Script to save webloc (From: Philip Aker <email@hidden>)
 >Re: Script to save webloc (From: Scott Haneda <email@hidden>)
 >Re: Script to save webloc (From: Fuller Luther <email@hidden>)
 >Re: Script to save webloc (From: Scott Haneda <email@hidden>)

  • Prev by Date: Re: count pages in PDF on OS 10.4
  • Next by Date: Calling a C Subroutine
  • Previous by thread: Re: Script to save webloc
  • Next by thread: Re: Script to save webloc
  • Index(es):
    • Date
    • Thread