• 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: AppleScriptObjC -- List Folder Handler
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AppleScriptObjC -- List Folder Handler


  • Subject: Re: AppleScriptObjC -- List Folder Handler
  • From: Nigel Garvey <email@hidden>
  • Date: Mon, 03 Dec 2018 08:53:36 +0000

Christopher Stone wrote on Sun, 02 Dec 2018 19:35:43 -0600:

>  else if returnType = "fsName" then
>    set {oldTIDS, AppleScript's text item delimiters} to {AppleScript's
text item delimiters, linefeed}
>    set itemList to ((theURLs's valueForKey:"lastPathComponent") as
list) as text
>    set theString to current application's NSString's
stringWithString:itemList
>    set stringLength to theString's |length|()
>
>    # Work around possible conversion of "/" to ":" in file name.
>    set theString to theString's
stringByReplacingOccurrencesOfString:":" withString:"/" options:(current
application's NSRegularExpressionSearch) range:{location:0,
|length|:stringLength}
>    set theString to theString as text
>    set theString to text items of theString
>    set AppleScript's text item delimiters to oldTIDS
>
>    return theString


Hi Chris.

You don't need AppleScript's TIDs or NSRegularExpressionSearch here.

  else if returnType = "fsName" then
    set itemArray to theURLs's valueForKey:"lastPathComponent"
    set theString to itemArray's componentsJoinedByString:linefeed

    # Work around possible conversion of "/" to ":" in file name.
    set theString to theString's stringByReplacingOccurrencesOfString:":"
withString:"/"
    set theNames to theString's componentsSeparatedByString:linefeed

    return theNames as list


NG

 _______________________________________________
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: AppleScriptObjC -- List Folder Handler (From: Nigel Garvey <email@hidden>)
 >Re: AppleScriptObjC -- List Folder Handler (From: Nigel Garvey <email@hidden>)

  • Prev by Date: Re: AppleScriptObjC -- List Folder Handler
  • Next by Date: Re: AppleScriptObjC -- List Folder Handler
  • Previous by thread: Re: AppleScriptObjC -- List Folder Handler
  • Next by thread: Re: AppleScriptObjC -- List Folder Handler
  • Index(es):
    • Date
    • Thread