Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread Display Modes
Old Apr 5, 2011, 03:38 PM   #1
the Otter
macrumors member
Join Date: Jan 2001
Location: Lafayette, IN
Send a message via AIM to the Otter
AppleScript: list files in folder

Okay, folks. This is an incredibly weird one. I know this has worked before. I stripped the code down to its barest form, so here it is, in its entirety:

tell application "Finder"
	set theFolder to choose folder
	set fileList to every file in theFolder
end tell
When I run it—regardless of the folder I choose—I get the following message:

AppleScript Error
Finder got an error: Can’t get alias "[path to folder]".

Anyone got any thoughts? I’m banging my head against this one.
“Aunque el mono se vista de seda, mono se queda.”
the Otter is offline   0 Reply With Quote
Old Apr 5, 2011, 03:49 PM   #2
macrumors 603
Join Date: Aug 2009
What OS version?

Where are you running it from? AppleScript Editor? Something else?

Exactly which folders have you tried it on? Be specific.

What user account are you logged in as?

Break It Down.

If you take out the second line, what is the resulting theFolder value? What is its type? Is it a string, an alias, a fnord, something else?

If you change the variable name from theFolder to myFolder or eineKleineFnordMusik, what happens?
chown33 is offline   0 Reply With Quote

MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

applescript, error, files, folder

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
Copy files to folder using Applescript Kitkat88 Mac Programming 10 May 20, 2015 01:28 PM
select data to use in "Choose From List" list in applescript ShuddaRunThat Mac Programming 2 Apr 1, 2014 06:31 PM
sorting a list of dates and times (applescript) wild4life2013 Mac Programming 2 Sep 6, 2013 08:02 PM
AppleScript - Button Returned of Results from a List JPinto Mac Programming 1 Jan 13, 2013 02:02 PM
Resolved: Applescript: List/txt.file question h1068 Mac Programming 5 Jul 3, 2012 06:30 PM

Forum Jump

All times are GMT -5. The time now is 07:13 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2015, MacRumors.com, LLC