Script performance and Safari
Script performance and Safari
- Subject: Script performance and Safari
- From: Mark Ratledge <email@hidden>
- Date: Fri, 13 Apr 2012 09:07:24 -0600
Is it possible to increase the performance of this script? It can take 3-4 seconds to run.
I've saved it as a script instead of an application, and that has helped with the speed, esp. the shell script and the interactions with BBEdit. The main speed problems seem to be with Safari, and I know the UI scripting is problematic.
Any ideas? Thanks
----------------------------------
Mark Ratledge
http://markratledge.com
> tell application "Safari"
> activate
> tell application "System Events"
> tell process "Safari"
> click menu item "Select All" of menu "Edit" of menu bar 1
> click menu item "Copy" of menu "Edit" of menu bar 1
> end tell
> end tell
> end tell
>
> tell application "Safari"
> set textclip to (the clipboard)
> set theUrl to (get URL of document 1)
> end tell
>
> try
> set the clipboard to Unicode text of (the clipboard as record)
> 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
> end tell
>
> tell application "BBEdit"
> activate
> 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
>
_______________________________________________
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