• 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: TextEdit things
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: TextEdit things


  • Subject: Re: TextEdit things
  • From: Christopher Stone <email@hidden>
  • Date: Tue, 25 Apr 2017 18:26:48 -0500

On 04/24/2017, at 19:35, Jean-Christophe Helary <email@hidden> wrote:
Ok, but that is in the Standard Suite, not in the TE suite. And when I explore my RTF documents in SD I don't find any indication that they are of a specific format.


Hey Jean-Christophe,

The file extension is generally going to tell you what format the document is.

If you want more then use the Finder or System Events or mdls...

------------------------------------------------------------------------------

tell application "Finder"
    set finderSelectionList to selection as alias list
    if length of finderSelectionList = 0 then error "No files were selected in the Finder!"
    set theItem to item 1 of finderSelectionList
end tell

tell application "System Events"
    set itemFinderInfo to properties of theItem
end tell

set itemInfo to info for theItem

set theItemPath to quoted form of (POSIX path of theItem)
set shCMD to "mdls " & theItemPath
set mdlsInfo to do shell script shCMD

------------------------------------------------------------------------------

TextEdit is a very useful, lightweight little app, but it has very poor scriptability.  Don't expect too much from it.

I'm checking what Accessibility Inspector gives for my file and I'm not seeing anything related to cursor position (which could be used a the position of the link to open etc.) 

Cursor position is generally not reported by Cocoa apps in a way that's accessible to a user.

Even UI Browser does not seem to know about the text that is not a link. Or am I missing something?

UI Browser knows more than you think.

Use the system-wide hotkey to go to the text entry area in TextEdit and then examine the attributes in the drawer carefully.

You can also run this and examine the bits in Script Debugger:

tell application "System Events"
    tell application process "TextEdit"
        tell (first window whose subrole is "AXStandardWindow")
            tell scroll area 1
                tell text area 1
                    set diagnosticsList to {¬
                        "----- PROPERTIES -----", ¬
                        properties, ¬
                        "----- UI ELEMENTS -----", ¬
                        UI elements, ¬
                        "----- ATTRIBUTES -----", ¬
                        attributes, ¬
                        "----- ACTIONS -----", ¬
                        actions, ¬
                        "----- END -----"}
                end tell
            end tell
        end tell
    end tell
end tell

If you want to know more then ask on the UI Browser Users List.

--
Take Care,
Chris

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >TextEdit things (From: Jean-Christophe Helary <email@hidden>)
 >Re: TextEdit things (From: Christopher Stone <email@hidden>)
 >Re: TextEdit things (From: Jean-Christophe Helary <email@hidden>)
 >Re: TextEdit things (From: Christopher Stone <email@hidden>)
 >Re: TextEdit things (From: Jean-Christophe Helary <email@hidden>)

  • Prev by Date: Another 'Mail' hassle
  • Next by Date: Re: Another 'Mail' hassle
  • Previous by thread: Re: TextEdit things
  • Next by thread: Syntax highlighting, compilation etc.
  • Index(es):
    • Date
    • Thread