• 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: AppleScript program to execute files
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AppleScript program to execute files


  • Subject: Re: AppleScript program to execute files
  • From: Timothy Bates <email@hidden>
  • Date: Thu, 16 Aug 2001 14:01:10 +1000

On 16/8/01 12:34 PM, "Scott Earleywine" <email@hidden> wrote:

> Hey all.
>
> I have a question...I am interested in creating an AppleScript application
> that will allow me to execute (i.e. Using CMD+O to 'open') a file.

tell finder
open file "your file"
end

>If I want "sound1" to play...I want to 'hit' Q,
> if I want "sound2" to play...I want to 'hit' W, if I want "sound3" to
> play...I want to 'hit' E.
property basePath : "Disk:folder:folder:"

repeat while not DONE
set theKey to item 1 of (keys pressed) --need jon's scripting addition
set playFile to "none"
if theKey is "1" then
my playFile("test1")
else if theKey is "2" then
my playFile("test2")
else
set DONE to true
end if
end repeat

to playFile(theName)
tell application "Finder"
open file (basePath & theName)
end tell
end playFile


  • Follow-Ups:
    • Re: AppleScript program to execute files
      • From: Scott Earleywine <email@hidden>
References: 
 >AppleScript program to execute files (From: Scott Earleywine <email@hidden>)

  • Prev by Date: folder path of open finder window?
  • Next by Date: Re: AppleScript program to execute files
  • Previous by thread: AppleScript program to execute files
  • Next by thread: Re: AppleScript program to execute files
  • Index(es):
    • Date
    • Thread