MACSCRPT Archives

May 2003

MACSCRPT@LISTSERV.DARTMOUTH.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Nobumi Iyanaga <[log in to unmask]>
Reply To:
Macintosh Scripting Systems <[log in to unmask]>
Date:
Wed, 7 May 2003 18:48:12 +0900
Content-Type:
text/plain
Parts/Attachments:
text/plain (39 lines)
Hello,

Is there any way to write a script:

tell the frontmost application
     ...
end tell
?

I tried several variations like this one:

set a to path to frontmost application
set b to info for a
set c to name of b

tell application c
        activate
        if exists (path of document 1) then
                set thePath to path of document 1
                set the clipboard to thePath
        else
                set thePath to "No Path"
                return
        end if
end tell

It works in Script Editor if the script has been already saved and put
the path of the script on the clipboard. But if I run it from Script
Menu when TextEdit or other applications is active, it does not work:
nothing is put on the clipboard.

Thank you for any insight.

Best regards,

Nobumi Iyanaga
Tokyo,
Japan

ATOM RSS1 RSS2