Re: AppleScriptObjC -- List Folder Handler
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