Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Mac > Applescript
|
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Applescript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old July 3rd, 2009, 02:51 PM
Registered User
 
Join Date: May 2008
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Applescript: Search for folders and setting path to folder

Hi All,

I am working on a script to allow the user to pick a folder. Once picked, I wanted a search of the subfolders to see if a folder exists. In my case it will be named "Proxy".

Once I have found this folder, I would like to basically "Set Proxyfolder to path to "Proxy" folder. This way, I can perform an action to this particular folder.

Also, in many cases there may be more than one subfolder by the same name of "Proxy." How would I know which folder I would be dealing with? So far, my code is like this:

Code:
property new_foldername : "PROXY"
set this_folder to (choose folder with prompt "Select the main shoot folder")

tell application "Finder"
	
	if (exists folder new_foldername of entire contents of this_folder) then
		set Proxypath to (POSIX path of new_foldername)
		
	else
		display dialog "Proxy folder is not found"
	end if
end tell
Thank you so much for your help!
Reply With Quote





Similar Threads
Thread Thread Starter Forum Replies Last Post
Class library folder path arunkhushi C# 1 February 4th, 2008 12:59 PM
grep-search for text within files, within folders crmpicco Linux 2 September 1st, 2007 10:23 AM
Accessing folders with absolute path having chars ravishakya Pro Java 0 September 18th, 2006 01:51 AM
How do I search TEXT in web folders and pages aatayyab PHP How-To 7 January 15th, 2006 01:08 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.