• 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: Script to insert the file name in TextWrangler
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Script to insert the file name in TextWrangler


  • Subject: Re: Script to insert the file name in TextWrangler
  • From: Christopher Stone <email@hidden>
  • Date: Sat, 09 Jan 2016 07:11:27 -0600

On Jan 08, 2016, at 01:48, CafeTran Wiki <email@hidden> wrote:
Could someone please help me with a script that copies the name of the open file without the path and the extension (.md) to the clipboard, for easy inserting in the open document?
______________________________________________________________________

Hey Hans,

Something like this?

--
Take Care,
Chris

------------------------------------------------------------
tell application "TextWrangler"
  tell front text document
    if on disk = true then
      set docName to its name
      if docName ends with ".md" then
        set the clipboard to text 1 thru -4 of docName
      else
        beep
      end if
    else
      beep
    end if
  end tell
end tell
------------------------------------------------------------

 _______________________________________________
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: 
 >Script to insert the file name in TextWrangler (From: CafeTran Wiki <email@hidden>)

  • Prev by Date: Re: Renamer script (CafeTran Wiki)
  • Next by Date: Re: How to Run a "sudo" Terminal Command
  • Previous by thread: Re: Script to insert the file name in TextWrangler
  • Next by thread: standard library
  • Index(es):
    • Date
    • Thread