Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Enthusiast Zone > Classic Macs and Mac OS > How can I tell if an object is a folder?

How can I tell if an object is a folder?
Thread Tools
Addicted to MacNN
Join Date: Jan 2000
Location: Stoneham, MA, USA
Status: Offline
Reply With Quote
Nov 23, 2000, 11:50 PM
 
I'm writing an AppleScript, and i can't seem to get the exact syntax down to check if a files is a folder or not. for instance

on open X
--is x a folder?
end open

Any know? not just an idea, i need to know the EXACT syntax. I've tried everythign I can think of.

------------------
L008 Com
Founding Member of the 'translucent' Party!
Vote for me in 2004!
"I didn't invent the internet, I made it better! And I don't even look like my dad!"
     
Mac Enthusiast
Join Date: Sep 2000
Location: AB, Canada
Status: Offline
Reply With Quote
Nov 24, 2000, 02:34 AM
 
how about something like this
'List of different file types
property type_list: {}
'This droplet process files dropped onto applet
on open X_items
----repeat with i from 1 to the count of X_items
------- set X_item to item i of X_items
------- set the X_info to info for X_item
------- if (folder of the X_info is false) and (alias of the X_info is false)
------- and (the file type of the X_info is in the type_list) then
------- process_X(X_item)
------- end if
----end repeat
end open
'this sub-rountine processes files
on process_X(X_item)
-- 'Note that the variable in X_item is a file reference in alias format
-- 'FILE PROCESSING STATEMENTS GOES HERE
end process_X

I hope this helps you. You can download different modules from the Applescript Guide Book to install in you help viewer from the Apple website. This guidebook shows you how to do a lot of things with Applescript.

[This message has been edited by crazycylon (edited 11-24-2000).]

[This message has been edited by crazycylon (edited 11-24-2000).]

[This message has been edited by crazycylon (edited 11-24-2000).]
As a man comes, so he departs.
     
l008com  (op)
Addicted to MacNN
Join Date: Jan 2000
Location: Stoneham, MA, USA
Status: Offline
Reply With Quote
Nov 24, 2000, 01:00 PM
 
All I needed was how to check if an item was a folder, the rest of the script was already written.
And that part works so thanks, but, I still keep getting these "Stack overflow" error messages when I try to run my script, any ideas on that? I've never gotten that message before in any script I've written.

------------------
L008 Com
Founding Member of the 'translucent' Party!
Vote for me in 2004!
"I didn't invent the internet, I made it better! And I don't even look like my dad!"
     
Grizzled Veteran
Join Date: Oct 1999
Location: Minneapolis
Status: Offline
Reply With Quote
Nov 24, 2000, 07:39 PM
 
What are you writting the script in (script editor?) what os are you using, and finally, how much memory do you have?
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -4. The time now is 06:17 PM.
All contents of these forums © 1995-2014 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2014, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2