# Using apple script to close folders

**URL:** <https://forum.kirupa.com/t/using-apple-script-to-close-folders/205023>\
**Category:** Uncategorized\
**Created:** [October 25, 2006, 1:23pm UTC](https://forum.kirupa.com/t/using-apple-script-to-close-folders/205023 "2006-10-25T13:23:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![zoo\_buffalo](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/zoo_buffalo/32/2467_2.png) [@zoo\_buffalo](https://forum.kirupa.com/u/zoo_buffalo)\
**Post date:** [October 25, 2006, 1:23pm UTC](https://forum.kirupa.com/t/using-apple-script-to-close-folders/205023/1 "2006-10-25T13:23:23Z")

</div>

hiya  
i’m working on a cd rom and using apple script to launch pdfs from flash. the trouble is that when the script runs, it causes the folders it’s looking in for the pdf to pop up on the screen. is there any way to avoid this? or otherwise to close the folders straight away once it has lauched the pdf file? the code i am using is:

tell application “Finder”  
activate  
select file “yourfile.pdf” of folder “yourfolder” of disk “YourDisk”  
open selection  
end tell

any ideas? thanks!  
emma.
