• 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: pass filenames to an application
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: pass filenames to an application


  • Subject: Re: pass filenames to an application
  • From: Andrew Oliver <email@hidden>
  • Date: Tue, 31 May 2005 15:03:17 -0700

On 5/31/05 2:41 PM, "dkd brain" <email@hidden> wrote:

> I am trying to do something that *should* be relatively simple, I want
> to grab a bunch of files (whose names start with the same string) in an
> arbitrary folder and open them in BBedit....
>
> I can figure out how to identify these files, but can't seem to pass
> the filenames back to BBedit
>
>
> i.e. here is the finder part
>
> set theItem to (choose folder) as string
> tell application "Finder"
> select (every file of folder theItem whose name begins with "AS ")
> end tell
>
>
> so, my little finder snippet correctly identifies the files I want to
> send to BBedit, but I can't figure out how to get these filenames into
> a bbedit tell statement
> i.e.
>
> tell application BBEdit
> open <filenames>
> end tell
>
> thanks for any advice....

1) Don't select the files in the Finder. It isn't necessary, it's cumbersome
and it gets in the way of the user. Instead:

 tell application "Finder"
   set theFIles to (every file of folder theFolder whose name begins with
"AS ")
 end tell

Now you have them in an AppleScript variable, without needing to open any
windows, change the selection, etc., etc., etc.

It's now trivial to:

  tell application "Finder"
    open theFiles using application "BBEdit"
  end tell

Andrew
:)

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >pass filenames to an application (From: dkd brain <email@hidden>)

  • Prev by Date: pass filenames to an application
  • Next by Date: Re: pass filenames to an application
  • Previous by thread: pass filenames to an application
  • Next by thread: Re: pass filenames to an application
  • Index(es):
    • Date
    • Thread