• 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: Passing argumenst to C executable from Apple script
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Passing argumenst to C executable from Apple script


  • Subject: Re: Passing argumenst to C executable from Apple script
  • From: Philip Aker <email@hidden>
  • Date: Fri, 18 Apr 2008 16:09:45 -0700

On 08-04-18, at 15:33, Shane Stanley wrote:

Or not quite so stringishly:

on containerOf(anAlias)
   set tid to text item delimiters
   set text item delimiters to ":"
   set containerPath to (text 1 thru text item -2 of (anAlias as Unicode
text)) & ":"
   set text item delimiters to tid
   containerPath as alias
end containerOf


Betcha the following will have potential bugs in it as well. In short, it's more reliable to go thru one of the known facilities.

set falias to ((path to desktop folder as text) & "Some Folder") as alias
set falias to ((path to desktop folder as text) & "Some File.txt") as alias
on GetAliasContainer(theAlias)
set finfo to info for theAlias
set txdl to text item delimiters
set text item delimiters to ":"
if (folder of finfo is true) then
set dirstr to text items 1 thru -3 of (theAlias as Unicode text)
else
set dirstr to text items 1 thru -2 of (theAlias as Unicode text)
end if
set text item delimiters to txdl
(dirstr as text) as alias
end GetAliasContainer

GetAliasContainer(falias)


Philip Aker
echo email@hidden@nl | tr a-z@. p-za-o.@

Sent from my SE/30

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >Re: Passing argumenst to C executable from Apple script (From: Shane Stanley <email@hidden>)

  • Prev by Date: Re: Passing argumenst to C executable from Apple script
  • Next by Date: Passed lists, references, and occasional errors
  • Previous by thread: Re: Passing argumenst to C executable from Apple script
  • Next by thread: Re: Passing argumenst to C executable from Apple script
  • Index(es):
    • Date
    • Thread