Skip navigation

If the Folder exist do this if not skip

364 Views 2 Replies Latest reply: Dec 7, 2012 6:06 AM by MattJayC RSS
MattJayC Level 1 Level 1 (0 points)
Currently Being Moderated
Dec 7, 2012 3:50 AM

Me again Here is the script I have for repositioning folders on my desktop top so that it looks nice and tidy,

 

tell application "Finder"

 

          set theHotFolder to (get first folder of desktop whose name starts with "Hot")

          set desktop position of theHotFolder to {2487, 150}

 

          set thesalFolder to (get first folder of desktop whose name starts with "Hal")

          set desktop position of thesalFolder to {2487, 60}

 

end tell

 

I'm trying to add a line that if the folder does not exist then just skip and go to next in the list?

 

Many Thanks

 

Matt

iMac, Mac OS X (10.6.8)
  • Austin Kinsella1 Level 6 Level 6 (11,505 points)
    Currently Being Moderated
    Dec 7, 2012 5:30 AM (in response to MattJayC)

    Either wrap it with try/end or use if exists ...

Actions

More Like This

  • Retrieving data ...

Bookmarked By (0)

Legend

  • This solved my question - 10 points
  • This helped me - 5 points
This site contains user submitted content, comments and opinions and is for informational purposes only. Apple disclaims any and all liability for the acts, omissions and conduct of any third parties in connection with or related to your use of the site. All postings and use of the content on this site are subject to the Apple Support Communities Terms of Use.