• 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: Stumped with open file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Stumped with open file


  • Subject: Re: Stumped with open file
  • From: Rob Stott <email@hidden>
  • Date: Wed, 20 Mar 2002 18:32:48 +0000

Hi there,
Not sure what9s causing the problem, but if the file is always in the same
file as the script then this should work (providing you save the script as
an application). There9s probably a much more elegant solution but at least
this works.
Good luck
R.




tell application "Finder"
try
set thePath to path to me as text
set theCount to the count of the characters of thePath
set thePath to ((characters 1 thru (theCount - 11) of thePath) as
text) & "CS_User_Tutorial.pdf"
open file thePath
on error
set thePath to choose file with prompt "Couldn't find file
'CS_User_Tutorial.pdf', please locate it"
end try
open file thePath

end tell
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Stumped with open file - correction!
      • From: Rob Stott <email@hidden>
References: 
 >Stumped with open file (From: "Leif E. Wells" <email@hidden>)

  • Prev by Date: Re: Error code
  • Next by Date: Re: Error code
  • Previous by thread: Stumped with open file
  • Next by thread: Re: Stumped with open file - correction!
  • Index(es):
    • Date
    • Thread