• 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: Strange problem with text item delimiters
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Strange problem with text item delimiters


  • Subject: Re: Strange problem with text item delimiters
  • From: David Crowe <email@hidden>
  • Date: Fri, 27 Jun 2003 22:44:35 -0400

Emmanuel;

This means that I could probably use "set ParsedFilename to text items of (name of aFile) as string" and avoid the intermediate variable.

Now, why would a filename need to be Unicode, particularly one that just uses pretty standard ASCII characters?

- David


At 10:35 AM -0400 27/06/03, David Crowe wrote:
I had the following code:

tell application "Finder"
-- set variable 'aFile' to an alias
set AppleScript's text item delimiters to "."
set ParsedFilename to text items of (name of aFile)
...
end



This code worked, and then suddenly stopped working, producing a null list given a string like "afilename.doc" (not even a list with a single item).


I replaced the code with:

set AppleScript's text item delimiters to "."
set x to (name of aFile)
set ParsedFilename to text items of (x as string)


... and it started working again.


Can anyone explain what happened? I'm using OSX with Smile as the editor, but the code is executed via FileMaker.

(I mean, I'm happy that I've found a workaround, but I really don't like mysteries like this).

It has something to see with the fact that the Finder returns the names of files as Unicode.

Emmanuel
_______________________________________________
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: 
 >Strange problem with text item delimiters (From: David Crowe <email@hidden>)
 >Re: Strange problem with text item delimiters (From: Emmanuel <email@hidden>)

  • Prev by Date: Re: Multi application support in single script [part 2 of 2]
  • Next by Date: url access scripting
  • Previous by thread: Re: Strange problem with text item delimiters
  • Next by thread: Re: Strange problem with text item delimiters
  • Index(es):
    • Date
    • Thread