• 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: (no subject) [Was] Access to a file via relative path
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: (no subject) [Was] Access to a file via relative path


  • Subject: Re: (no subject) [Was] Access to a file via relative path
  • From: Emmanuel <email@hidden>
  • Date: Tue, 15 Oct 2002 18:11:15 +0200

At 3:04 PM +0200 15/10/02, Markus Wick wrote:

In addition to what Simon and Mr Tea replied, you will probably need at some step to turn some path into a list, manipulate the last items of the list, then turn the list back into a file path.

The basic tool for that is the "text item delimiters".

A short example to get you started without reading the documentation :-)

---------- untested
set AppleScript's text item delimiters to ":"
set thePath to thePath as text -- suppose it's a file reference or an alias
-- returns, e.g. "startupdisk:folder1:folder2:data:tools:myfirstscript";
set theList to text items of thePath
-- makes the string into a list of strings
-- {"startupdisk", "folder1", "folder2", "data", "tools", "myfirstscript"}
set theList to (items 1 thru -3 of theList) & "filemakerdata"
-- {"startupdisk", "folder1", "folder2", "data", "filemakerdata"}
set theNewPath to theList as text
-- "startupdisk:folder1:folder2:data:filemakerdata:";
set theNewPath to alias theNewPath
-- error: file "startupdisk:folder1:folder2:data:filemakerdata:"; was not found - doh!
--------------

Emmanuel

Sorry I can't reread, Eudora has turned everything into red underlined. JD, can't you do a thing so that it recognize variable names?
_______________________________________________
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.
References: 
 >(no subject) (From: Markus Wick <email@hidden>)

  • Prev by Date: QuickTime Player Scripting
  • Next by Date: Re: Access to a file via relative path -- was Re: (no subject)
  • Previous by thread: Re: Access to a file via relative path -- was Re: (no subject)
  • Next by thread: (no subject)
  • Index(es):
    • Date
    • Thread