p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/)
-   Applescript (http://p2p.wrox.com/applescript-191/)
-   -   Applescript: Search for folders and setting path to folder (http://p2p.wrox.com/applescript/75089-applescript-search-folders-setting-path-folder.html)

pickup July 3rd, 2009 03:51 PM

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:

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


All times are GMT -4. The time now is 02:28 AM.

Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
2013 John Wiley & Sons, Inc.