• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Slight deviation, big problem with script
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Slight deviation, big problem with script


  • Subject: Re: Slight deviation, big problem with script
  • From: Michelle Steiner <email@hidden>
  • Date: Mon, 23 May 2011 09:17:11 -0700

On May 23, 2011, at 8:56 AM, Jeffrey Madson wrote:

n the first line I took out the word utilities and put in Options folder which creates an error. I also changed the set folderpath to line to: set folderpath to (("Options")) as text) & "RRDAuto" but the script never gets that far.

Any suggestions on how to get this script corrected would be greatly appreciated.

-- create RRDAuto folder
set x to path to utilities folder

The reason is that utilities folder is a defined folder in Standard Additions.  Options Folder is not.

You will have to specifically designate the Options folder.  Here's an example for an Options Folder at the user folder.

set optionsFolder to ((path to home folder) as text) & "Options"
tell application "Finder"
if not (exists folder optionsFolder) then set optionsFolder to make new folder at (path to home folder) with properties {name:"Options"}
end tell

There's also an error in this snippet from your code:

set x to path to utilities folder
set y to x & "RRDAuto" as string
tell application "Finder"
if exists y then
else
set y to make new folder at x with properties {name:"RRDAuto"}
my Set_Icon()
end if
end tell

y is  string, so you're asking the Finder whether a string exists; you need to ask it whether a folder exists.  Also, if you insert "not" before "exists", you can remove "else" and make the code a bit more readable.

-- Michelle

-- 
"Growth for the sake of growth is the ideology of the cancer cell."


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >Slight deviation, big problem with script (From: Jeffrey Madson <email@hidden>)

  • Prev by Date: Re: Export MS Excel range to a PDF file
  • Next by Date: Re: Slight deviation, big problem with script
  • Previous by thread: Re: Slight deviation, big problem with script
  • Next by thread: Re: Slight deviation, big problem with script
  • Index(es):
    • Date
    • Thread