• 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: Scripting Terminal ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Scripting Terminal ?


  • Subject: Re: Scripting Terminal ?
  • From: Christopher Stone <email@hidden>
  • Date: Sat, 18 Apr 2015 20:45:46 -0500

On Apr 18, 2015, at 19:15, Christopher Stone <email@hidden> wrote:
This script works well on my 10.9.5 system.
______________________________________________________________________

Hey Folks,

I realized I'd put set frontmost inside the loop and fixed that.

I also changed the delays, so my keyboard shortcut in FastScripts didn't eat part of System Events' Cmd-T.

-ccs

---------------------------------------------------------------
tell application "Finder" to set fSel to selection as alias list

set fileCount to (length of fSel) - 1

repeat with i in fSel
  set contents of i to (quoted form of (POSIX path of i))
end repeat

tell application "Terminal" to do script

delay 0.5

tell application "System Events" to tell application process "Terminal"
  set frontmost to true
  repeat fileCount times
    keystroke "t" using {command down}
  end repeat
end tell

delay 0.5

tell application "Terminal"
  tell front window
    set selected tab to its tab 1
    repeat with i from 1 to count of tabs
      do script "emacs " & item i of fSel in tab i
    end repeat
  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: 
 >Scripting Terminal ? (From: Jean-Christophe Helary <email@hidden>)
 >Re: Scripting Terminal ? (From: Christopher Stone <email@hidden>)
 >Re: Scripting Terminal ? (From: Jean-Christophe Helary <email@hidden>)
 >Re: Scripting Terminal ? (From: Christopher Stone <email@hidden>)
 >Re: Scripting Terminal ? (From: email@hidden)
 >Re: Scripting Terminal ? (From: Jean-Christophe Helary <email@hidden>)
 >Re: Scripting Terminal ? (From: Christopher Stone <email@hidden>)

  • Prev by Date: Re: Scripting Terminal ?
  • Next by Date: Re: Scripting Terminal ?
  • Previous by thread: Re: Scripting Terminal ?
  • Next by thread: Re: Scripting Terminal ?
  • Index(es):
    • Date
    • Thread