request for Safari to Filemaker de-bugging assistance
request for Safari to Filemaker de-bugging assistance
- Subject: request for Safari to Filemaker de-bugging assistance
- From: Erik Ness <email@hidden>
- Date: Wed, 15 Dec 2004 19:06:12 -0600
Greetings,
I use the script below to clip the contents of a
series of a series of open Safari pages into a
database. It's been working fine for several
months, but lately it's been stuttering: If it
does 20 windows, anywhere from the last 3 to 15
will all enter the same block of copied text,
even as it correctly enters the url and the page
title. I figure it has to be a problem with the
system events or setting the clipboard:
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
tell application "Safari"
set r to the clipboard
close window 1
end tell
But am at a loss as to how to proceed. Any
feedback on any element of the script is
gratefully appreciated.
Regards,
Erik Ness
Full script:
set n to 0
tell application "Safari"
activate
display dialog ¬
"Top window or all?" buttons {"All", "Topmost"} ¬
default button "All"
set OneOrAll to (button returned of result)
if OneOrAll = "Topmost" then
set n to 1
else
set n to the number of documents
end if
end tell
tell application "FileMaker Pro"
activate
open "filepathto:someDB:someDB.fp7"
tell database "someDB.fp7"
set gHot to cell "gHotfile" of table "someDB"
end tell
display dialog ¬
"Set keyword to the active project?" default answer gHot
set k to (text returned of result)
end tell
set i to 0
repeat until i = n
tell application "Safari"
activate
set t to name of window 1
set s to URL of document 1
end tell
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
tell application "Safari"
set r to the clipboard
close window 1
end tell
tell application "FileMaker Pro"
activate
-- open "filepathto:someDB:someDB.fp7"
tell database "someDB.fp7"
go to layout "Card Catalog"
create new record in table "Library"
set cell "Title" of last record in table "Library" to t
set cell "Text" of last record in table "Library" to r
set cell "Bibliography"
of last record in table "Library" to s
set cell "KeyWords" of
last record in table "Library" to k
end tell
end tell
set i to i + 1
end repeat
tell application "Finder"
activate
display dialog "Thanks for that." giving up after 60
end tell
--
###########################
Erik Ness <email@hidden> 608-242-7604
Stuck in Reverse: http://www.nrdc.org/onearth/05win/detroit1.asp
Moving Mountains:
http://www.uwalumni.com/onwisconsin/2004_winter/mountains.html
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden