Re: How to make file references to text
Re: How to make file references to text
- Subject: Re: How to make file references to text
- From: Hugh Dixon <email@hidden>
- Date: Tue, 16 Oct 2001 14:02:05 +0100
On 16/10/01 12:27 pm, email@hidden of email@hidden
wrote in whole or in part:
>
Hi all
>
>
How to make file references to text?
>
on open these_items
>
tell application "Finder"
>
set filePath to alias "Sive Lindmark:Users:sive:Desktop:Working
>
with!!!!!!:Drop sicomp.se:Output"
>
tell application "Tex-Edit Plus"
>
open file filePath
>
tell window "Output"
>
select last insertion point
>
end tell
>
end tell
>
end tell
>
repeat with i from 1 to the count of these_items
>
set the this_item to item i of these_items
>
copy this_item as text to selection
>
end repeat
>
end open
>
If you want an application to do something, you have to tell it within the
"tell" block. Your tell blocks end before you actually try to put the text
where you want it. Additionally, Tex_edit plus will open files without
involving the Finder:
tell application "tex-edit plus" to open file "Sive Lindmark:Users: etc etc
etc..."
It's not clear if you want to put the path to the dropped file into your
Tex-edit Plus file, or the contents.
If the former, this may help (OS 9.2.1):
on open these_items
repeat with each_item in these_items
set items_name to each_item as text
tell application "Tex-Edit Plus"
tell front document
make new paragraph at end with data items_name
end tell
end tell
end repeat
end open
If the latter, try:
on open these_items
repeat with each_item in these_items
set items_contents to read each_item
tell application "Tex-Edit Plus"
tell front document
make new paragraph at end with data items_contents
end tell
end tell
end repeat
end open
(although this will error if you drop a folder onto it).
Tex_edit plus will open files without involving the Finder:
tell application "tex-edit plus" to open file "Sive Lindmark:Users: etc etc
etc..."
HTH
Hugh
**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.
www.mimesweeper.com
**********************************************************************