• 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 19:15:49 -0500

On Apr 18, 2015, at 07:25, Jean-Christophe Helary <email@hidden> wrote:
That's really not what I wanted to hear…
______________________________________________________________________

Hey Jean-Christophe,

The truth is sometimes a bitter pill to swallow, but it's better than wasting hours of time.

My rule-of-the-thumb is to start asking questions if I can't make genuine progress within an hour or so.

Automator leaves me cold.  I use FastScripts & Keyboard Maestro to run AppleScripts on my system (mostly with keyboard shortcuts).

* KM of course will do much more than run AppleScripts.

This script works well on my 10.9.5 system.

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

set fileCount to length of fSel
set fileCount to fileCount - 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

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

delay 1

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

I dislike the aesthetics of this solution, but it works.

--
Best Regards,
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: Scripting Terminal ?
      • From: Christopher Stone <email@hidden>
    • Re: Scripting Terminal ?
      • From: Jean-Christophe Helary <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>)

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