• 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: Any way to use "path to me" when a script/app is hidden
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Any way to use "path to me" when a script/app is hidden


  • Subject: Re: Any way to use "path to me" when a script/app is hidden
  • From: Christopher Nebel <email@hidden>
  • Date: Wed, 5 Dec 2007 15:43:37 -0800

On Dec 5, 2007, at 3:27 PM, David A. Cox wrote:

I am trying to make an applescript that will work if it is hidden or not. I would like it to do tome things to the files that are in the folder with it.

The following script works fine if it is saved in a folder, but if I make the application hidden, it tosses up the error (the "fullPathToTheApp" is replaced by the real path:
"Can't make alias "FullPathToTheApp" into type file.


I am making the app hidden with the 'chflags hidden' command in terminal.

Does anyone know of a way to make 'path to me' work in this type of environment?

The sample script is:

tell application "Finder"
	activate
	set folderpath to (path to me)'s folder
	set mypath to path to me
	set MyName to name of file mypath
	set selection to {}
	select (every item of folderpath whose name is not MyName)
	select every item of folderpath
end tell

I assume it errors on the "set MyName to name of file mypath" line? Finder won't let you refer to a "file" or "folder" that is hidden. It will, however, let you refer to a hidden "item".



--Chris Nebel AppleScript Engineering

_______________________________________________
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
  • Follow-Ups:
    • Re: Any way to use "path to me" when a script/app is hidden
      • From: "David A. Cox" <email@hidden>
References: 
 >Any way to use "path to me" when a script/app is hidden (From: "David A. Cox" <email@hidden>)

  • Prev by Date: Any way to use "path to me" when a script/app is hidden
  • Next by Date: Re: Renaming files
  • Previous by thread: Any way to use "path to me" when a script/app is hidden
  • Next by thread: Re: Any way to use "path to me" when a script/app is hidden
  • Index(es):
    • Date
    • Thread