• 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 TID bug OS 10.2.5?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AppleScript TID bug OS 10.2.5?


  • Subject: Re: AppleScript TID bug OS 10.2.5?
  • From: John Delacour <email@hidden>
  • Date: Thu, 24 Apr 2003 20:30:32 +0100
  • Mac-eudora-version: 6.0a16

At 6:33 pm +0200 24/4/03, julifos wrote:

> Viewer. It will be easy to discover what they are doing wrong -- and
they are certainly doing something wrong.

JD

Perhaps I should explain this better.

I still find your style verbose and superfluous, and besides you are neither allowing for the final colon on folders nor replacing it when you have found it, no allowing for paths to disks, so the script is always going to be unreliable. I would do it like this and I'd be surprised if this broke on anyone's machine. I rest my case.



set ls to {path to me, path to "cusr", path to startup disk}
open ls
--
on open ls
set {f, _colon} to {"" & item 1 of ls, false}
if f ends with ":" then set {f, _colon} to {text 1 through -2 of f, true}
set text item delimiters to ":"
if (count text items of f) is 1 then return {"", f & ":"}
set _container to "" & text items 1 thru -2 of f & ":"
set _file to last text item of f
if _colon then set _file to _file & ":"
set text item delimiters to ""
{_container, _file}
end open




The script doing something wrong is MY script. And some users (2 users at
this moment) of my script have experimented this error since they upgraded
their OS. So, "before upgrade = works cool"; "after upgrade = something is
wrong" (with my script and other applescript-based apps; 1 user mentioned
errors with split&concat, which is an AppleScript Studio app).

I posted the code before, but I'll post it again for better exposition:

#################################
on open these_files

--> <snip>
--> test "these_files" to make sure user dropped only 1 file

set thisFile to these_files's item 1

--> <snip>
--> more unrelated stuff

set AppleScript's text item delimiters to ":"
set folder_ to text items 1 thru -2 of (thisFile as text) & "" as text
--> ERROR!!!
set file_ to text item -1 of (thisFile as text)
set AppleScript's text item delimiters to {""}
--> <snip>
end open
#################################
_______________________________________________
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: AppleScript TID bug OS 10.2.5?
      • From: julifos <email@hidden>
References: 
 >Re: AppleScript TID bug OS 10.2.5? (From: julifos <email@hidden>)

  • Prev by Date: Re: AppleScript TID bug OS 10.2.5?
  • Next by Date: Re: Language at a Glance
  • Previous by thread: Re: AppleScript TID bug OS 10.2.5?
  • Next by thread: Re: AppleScript TID bug OS 10.2.5?
  • Index(es):
    • Date
    • Thread