• 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-Users Digest, Vol 12, Issue 16
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AppleScript-Users Digest, Vol 12, Issue 16


  • Subject: Re: AppleScript-Users Digest, Vol 12, Issue 16
  • From: Shane Stanley <email@hidden>
  • Date: Fri, 09 Jan 2015 19:49:06 +1100

On 9 Jan 2015, at 6:39 pm, John Mitchell <email@hidden> wrote:

in SD 5.0.9, OSX 10.9.5

OK. In SD, choose File -> New Script from Template, then choose AppleScript on the left, and check both Script Bundle and AppleScript Objective-C. Click Choose, then save it in ~/Library/Script Libraries/ as a script bundle (.scptd). You may have to create this folder.

Paste in the script, putting the start in a handler something like this:

use scripting additions
use framework "Foundation"

on listFolderContents:thePath
-- this where we'll store the stuff as we collect it; we could use a list, but it could get very long
set finalNSArray to current application's NSMutableArray's array()
-- make NSURL of where to start
set anNSURL to current application's |NSURL|'s fileURLWithPath:thePath
-- call our handler
my listURL:anNSURL inArray:finalNSArray
-- join the strings in the array, and convert it to an AS string
return (finalNSArray's componentsJoinedByString:linefeed) as text
end listFolderContents:

Save again. Now open a new script and enter this:

tell script "<name of script>"
set theResult to its listFolderContents:(POSIX path of (choose folder))
end tell

<name of script> should be whatever you named the first file (minus the .scptd extension). 

Click Execute...

-- 
Shane Stanley <email@hidden>
<www.macosxautomation.com/applescript/apps/>

 _______________________________________________
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: AppleScript-Users Digest, Vol 12, Issue 16 (From: John Mitchell <email@hidden>)

  • Prev by Date: Re: AppleScript-Users Digest, Vol 12, Issue 16
  • Next by Date: Re: Script that "Tells" Finder just Focuses on Finder instead of running
  • Previous by thread: Re: AppleScript-Users Digest, Vol 12, Issue 16
  • Next by thread: Ping or Check for LAN IP
  • Index(es):
    • Date
    • Thread