Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Kudos | 15 comments | Create New Account
Click here to return to the 'Kudos' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Authored by: ClarkGoble on Oct 24, '02 09:34:02PM

Many thanks to Mithras for his script. I've already made use of it extensively since I know little Applescript and was trying to do the same thing using only online documentation.

Paul McCann over on MacNN Forums suggested the following modifications to the script. (I'll snip the relevant portions of his post)

That osascript monstrosity can be considerably simplified. The trick is to use backticks to capture the output of a heredoc; took me a while to get right, but having done so it's surprisingly robust and helpful. Something like

tell app "Finder"
set theItem to (POSIX file "${item_path}") as alias
if the kind of theItem is "alias" then
get the posix path of (original item of theItem as text)
end if
end tell

is a lot prettier than that multi-line construction. The heredoc contents need be little more than a paste the original applescript. Note the loss of the extra quote marks around the variable in there as well.

Only other suggestion I'd make is to use "ln" to overwrite existing aliases. That is, instead of deleting them yourself, just use

ln -fs whereeveritis whateveritisyouwanttocallit

[ Reply to This | # ]
Authored by: bluehz on Oct 25, '02 08:15:52AM

Script does work great! Thanks!

Not specific to this script - but does anyone know how to get rid of the msgs generated by OSAScript within the terminal. For example - in this script - run from the terminal you get:

## Component Manager: attempting to find symbols in a component alias of type (imco/SVQ3/SMI )
## Component Manager: attempting to find symbols in a component alias of type (regR/carP/x!bt)
## Component Manager: attempting to find symbols in a component alias of type (imdc/MP42/MSFT)
ASW CFM Init; App: osascript
2002-10-25 08:13:57.370 osascript[12594] WARNING: _wrapRunLoopWithAutoreleasePoolHandler got kCFRunLoopExit, but there are no autorelease pools in the stack.
ASW CFM Terminate; App: osascript

Not that its a big deal - script still runs fine. Just an esoteric, anal thang....

[ Reply to This | # ]
Component Manager warnings
Authored by: hayne on Oct 25, '02 12:30:21PM

I think I recall that the Component Manager warnings are related to Toast.
Do a search on the forums or on google if needed and you'll see what I mean. I don't recall exactly but I think the fix was as simple as removing a cache file or something.

[ Reply to This | # ]