Frontmost App and --Script Menu-- (oops)
Frontmost App and --Script Menu-- (oops)
- Subject: Frontmost App and --Script Menu-- (oops)
- From: Irwin Poche <email@hidden>
- Date: Sun, 11 Apr 2004 19:36:10 -0500
I am almost finished (so I thought) making a script that will paste a
URL from Safari. To do so, I need to get the frontmost application
then use UI to do the Edit:Paste menu.
The script below does this - all but the UI Paste part. When run in
Script Editor, the dialog displays "Script Editor" but when run from
the 10.3.3's script menu, it says "System Events".
Can I do what I'm wanting to do and, if so, how ?
-Irwin
tell application "Safari"
set URLlist to {}
repeat with thisD in documents
set URLlist to URLlist & URL of thisD
end repeat
end tell
if (count of URLlist) = 1 then
set z to item 1 of URLlist
else if (count of URLlist) > 1 then
set z to choose from list URLlist without multiple selections allowed
else
set z to ""
beep
end if
set the clipboard to "<" & z & ">"
display dialog FrontmostApp()
on FrontmostApp()
tell application "System Events"
return (name of (every application process whose frontmost is true)
as string)
end tell
end FrontmostApp
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.