• 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 performance and Safari
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Script performance and Safari


  • Subject: Re: Script performance and Safari
  • From: KOENIG Yvan <email@hidden>
  • Date: Fri, 13 Apr 2012 18:10:19 +0200

Try :

tell application "Safari"
activate
tell application "System Events"
tell process "Safari"
keystroke "ac" using {command down}
end tell
end tell
tell current application to set textclip to (the clipboard)
set theUrl to (get URL of document 1)
end tell

try
set the clipboard to (the clipboard as Unicode text)
end try

set dat to (do shell script "date '+%m/%d/%y' | sed -e 's/000$//' -e 's/^0//'") as string

tell application "BBEdit" 
activate
make new document
set text of front document to (dat & return & return & (theUrl) & return & return & textclip & return)
select insertion point 1 of contents of front document
select text 1 of text window 1
straighten quotes selection of text window 1 with replacing target
select insertion point 1 of contents of front document
end tell

Just a question :
Why are you converting the clipboard's contents to Unicode and insert the original contents in the created document ?

Yvan KOENIG (VALLAURIS, France) vendredi 13 avril 2012 18:07:02





 _______________________________________________
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

  • Follow-Ups:
    • Re: Script performance and Safari
      • From: Ed Babcock <email@hidden>
References: 
 >Script performance and Safari (From: Mark Ratledge <email@hidden>)

  • Prev by Date: Men’s health and Viagra
  • Next by Date: Re: AppleScript-Users Digest - increase the performance of this script
  • Previous by thread: Script performance and Safari
  • Next by thread: Re: Script performance and Safari
  • Index(es):
    • Date
    • Thread