Re: Any way to use "path to me" when a script/app is hidden
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: "David A. Cox" <email@hidden>
- Date: Wed, 5 Dec 2007 16:33:52 -0800
Perfect.
This is exactly the small tweak my script needed.
Thanks for the fast and clear response!
DAC
On Dec 5, 2007, at 3:43 PM, Christopher Nebel wrote:
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