• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Find Insertion Point
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Find Insertion Point


  • Subject: Re: Find Insertion Point
  • From: "Marc K. Myers" <email@hidden>
  • Date: Sun, 17 Dec 2000 10:29:09 -0500
  • Organization: [very little]

"email@hidden" wrote:
>
> Den 00-12-16 18.31, skrev "Marc K. Myers" <email@hidden>:
>
> > Paul Berkowitz wrote:
> >> Date: Thu, 14 Dec 2000 19:46:30 -0800
> >> Subject: Find Insertion Point
> >> From: Paul Berkowitz <email@hidden>
> >> To: Applescript-Users <email@hidden>
> >> Cc: "Christopher C. Stone" <email@hidden>
> >>
> >> Does anyone know if it's possible to get the "coordinates" of the insertion
> >> point in an MS Word document? If you know a way in some other app that
> >> supports the Text Suite, I'll give it a go here. I want to find a location
> >> that way that I can later use to insert text at that location.
> >
> > I don't have MS word, but in Tex-Edit Plus you can say:
> >
> > set x to the insertion point of window 1
> >
> > It returns the offset in characters. So, while you can't copy anything
> > directly to the insertion point, you can accomplish the same thing by saying:
> >
> > tell application "Tex-Edit Plus"
> > activate
> > set x to the insertion point of window 1
> > copy "Hello!" to after character x of window 1
> > end tell
> >
> > I hope this will help.
> >
> > Marc [12/16/00 12:31:01 PM]
> > _______________________________________________
> > applescript-users mailing list
> > email@hidden
> > http://www.lists.apple.com/mailman/listinfo/applescript-users
>
> Hi,
>
> I have the same problem, sort of...
>
> I have a script that checks for files in a folder and when get the filenames
> abd paste them into a document.
>
> The problem I have is that I got no linebreaks, the filenames is pasted in a
> row. How do I get linebreaks?
>
> Ex.
> File_1 File_2 File_3
>
> I would like to have it like this:
> File_1
> File_2
> File_3
>
> The script:
>
> tell application "Tex-Edit Plus"
> activate
> make new document
> end tell
> tell application "Finder"
> activate
> set searchFolder to alias "Macintosh HD:Letar:"
> set destfolder to alias "Macintosh HD:Klara letar:"
> set myList to list folder searchFolder without invisibles
> repeat with myfilename in every item in myList
> set myfile to alias ("Macintosh HD:Letar:" & myfilename)
> select file ("Macintosh HD:Letar:" & myfilename)
> activate
> copy
> tell application "Tex-Edit Plus"
> activate
> paste selection
> move myfile to destfolder
> end tell
> end repeat
> end tell
>
> Any thoughts?

This approach accomplishs the line breaks by adding "& return" to the
text being copied.

tell application "Tex-Edit Plus"
activate
make new window
end tell
set srchFldr to alias "Macintosh HD:Letar:"
set destFldr to alias "Macintosh HD:Klara letar:"
tell application "Finder" to set {itemList, nameList} to [optn-L]
{items of srchFldr, name of items of srchFldr}
set theCnt to count items of itemList
repeat with i from 1 to theCnt
tell application "Tex-Edit Plus" to copy item i of nameList & return
to [optn-L]
after the contents of window 1
tell application "Finder" to move contents of item i of itemList to destFldr
end repeat

Marc [12/17/00 10:27:29 AM]


References: 
 >Re: Find Insertion Point (From: "email@hidden" <email@hidden>)

  • Prev by Date: What's an FSS? (newbie)
  • Next by Date: Re: Scripting style [was Re: Newbie Progress Bar]
  • Previous by thread: Re: Find Insertion Point
  • Next by thread: Re: Find Insertion Point
  • Index(es):
    • Date
    • Thread