• 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: Pathname Weirdness
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Pathname Weirdness


  • Subject: Re: Pathname Weirdness
  • From: Michelle Steiner <email@hidden>
  • Date: Mon, 8 May 2006 07:59:37 -0700


On May 8, 2006, at 7:38 AM, Jonathan Piccolo wrote:

property antiPiracy : alias ((path to home folder as Unicode text) & "Library:Preferences:")

You can replace that with

path to preferences folder from user domain

if (not (exists folder ".aPCheck" of antiPiracy as string)) then
display dialog "This script was not installed correctly. Please reinstall." buttons {"Quit"} default button 1 error number -128 -- Quit was pressed
end if


Upon compilation, I get the following error: Syntax Error: Expected “, ” but found “.

Then it highlights the first quotation mark in ".aPCheck"

You need to put that inside a 'tell application "finder"' block, and you need to remove "as string" from it. You're looking for a folder, not a string.


In addition to why I'm getting this error, I'm confused about how to store these paths so that they are properly passed/parsed, etc and I believe this is the entire problem to begin with.

I'm not sure what you mean.

Also, I'd like to be able to pass on a path as a string to be compared with an actual real path to verify a certain file/folders existence. In the past I would get an error upon compiling that the file/folder in question did not exist (I know!)

If you refer to them with "file" or "folder" it will compile, but if you refer to them with "alias", they won't compile. If you need to refer to them as alias, can get around that limitation by assigning the names to variables. There is no need to convert paths to strings, though.


property antiPiracy : path to preferences folder from user domain
set folderName to ".aPCheck"
tell application "Finder"
if (not (exists alias folderName of antiPiracy)) then
display dialog "This script was not installed correctly. Please reinstall." buttons {"Quit"} default button 1 error number -128 -- Quit was pressed
end if
end tell


-- Michelle

--
"I'll see that when I believe it"

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Pathname Weirdness
      • From: Jonathan Piccolo <email@hidden>
References: 
 >Pathname Weirdness (From: Jonathan Piccolo <email@hidden>)

  • Prev by Date: Pathname Weirdness
  • Next by Date: Re: URL Access Scripting with progress
  • Previous by thread: Pathname Weirdness
  • Next by thread: Re: Pathname Weirdness
  • Index(es):
    • Date
    • Thread