• 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: Mon, 24 Apr 2017 18:16:06 -0500

On 04/24/2017, at 02:41, Jean-Christophe Helary <email@hidden> wrote:
Yes, but I did not think it was the same thing... I don't understand that just adding the name property changes the nature of the file (now, it that's a bug, that's a different thing :)


Hey Jean-Christophe,

You can't give a document a name and then save it to a folder path.

You have to provide the full save-path.

This seems to work:

save as "com.apple.rtfd" in file destPath

Ok, so you confirm that there is no "format" property or anything in TE, right ?

command syntax

save reference ¬
     as text ¬
     in alias

parameters

Parameter
Required
Type
Description
direct parameterrequiredreferencethe object for the command
asoptionaltextThe file type in which to save the data.
inoptionalaliasThe file in which to save the object.

rtfd is a file type.

To contrast – try saving as this:

save as "public.plain-text" in file destPath

Be sure to change the file extension too.

Save as any given file-type and get the Type Identifier of the file – splice it into the script and test.

 can't.  System Events sees them but only offers the ability to click the link – not open.

Ok, but that would actually result in opening the thing right?  Which would for for me. I just need to have the thing be on a link and "click" it to open the target file.

If all you need to do is click the link then it's not too difficult.

------------------------------------------------------------------------------
# Auth: Christopher Stone
# dCre: 2017/04/24 18:05
# dMod: 2017/04/24 18:13 
# Appl: TextEdit, System Events
# Task: Click first hyperlink in a RTF document.
# Libs: None
# Osax: None
# Tags: @Applescript, @Script, @System_Events, @TextEdit, @Click, @Hyperlink, @RTF, @Document
------------------------------------------------------------------------------

tell application "System Events"
    tell application process "TextEdit"
        tell (first window whose subrole is "AXStandardWindow")
            tell scroll area 1
                tell text area 1
                    tell (first UI element whose role description is "hyperlink")
                        perform action "AXPress"
                    end tell
                end tell
            end tell
        end tell
    end tell
end tell

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

--
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

  • Follow-Ups:
    • Re: TextEdit things
      • From: Jean-Christophe Helary <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>)

  • Prev by Date: Re: Safari on macOS 10.12.4 – Window Issues
  • Next by Date: Re: Safari on macOS 10.12.4 – Window Issues
  • Previous by thread: Re: TextEdit things
  • Next by thread: Re: TextEdit things
  • Index(es):
    • Date
    • Thread