|
|
Uninstall an AppleScript application from within Itself
No shell scripting required, I just prefer to avoid using another application (in this case the Finder) to achieve anything in AppleScript. I personally don't have the Finder running very often. So, the Finder would have to launch to throw the item in the trash for me, where a shell script silently accomplishes the same task.
Uninstall an AppleScript application from within Itself
err... you "prefer to avoid using another application [...] to achieve anything in AppleScript"? Applescript was designed for inter-application scripting - I'm not sure what you'd use it for without scripting other apps, and there are any number of superior languages for regular run-of-the-mill programming.
At any rate, applescript is not going to move the file to the trash on its own. Scripting the Finder is easy and convenient for most people, who have the Finder running all the time, but if you don't use the Finder then you're going to have to script PathFinder, or script System Events, or script unix, or script some other app or process that has the capacity to work with the file system. That's just the nature of the applescript beast. You've actually got me curious, though: I wonder what percentage of os X users don't use the Finder? I've gotta think it's less than 1%, even among the tech-oriented people you find on this site. Maybe I can get Rob to post a survey.
Uninstall an AppleScript application from within Itself
Ummm, yes I prefer to avoid using another application via AppleScript to achieve any goal I'm trying to achieve. If I have to I will, but otherwise I won't. Ever since "do shell script" came out I've tried to use it exclusively. Yes, most people have the Finder running all the time, I don't. I wrote the script posted above which does not call upon any other actual application to achieve the desired results. I know there are other languages that are better, but this hint was about AppleScript. I find scripting the Finder to be tedious and slower in producing results than using AppleScript's "do shell script" command. That's a personal preference based on over 20 years worth of experience using AppleScript. The true nature of the "AppleScript beast" is options. There are tons of different ways in which an individual can write a script to achieve his/her desired goal. Neither way is necessarily wrong unless the script is failing. Like I said in my reply to your post, "Your script worx great as well though!", meaning exactly that. It was a compliment to using a different approach than I myself used. I was just giving a reason as to why I wrote my script the way I did.
Uninstall an AppleScript application from within Itself
I'm not suggesting that your approach doesn't work, or that it's a bad way to do it. I'm just thinking that it's needlessly complex for the average user. You can work with your system any way you want to, but the way you use it is not necessarily what I would recommend to everyone else reading this thread.
Uninstall an AppleScript application from within Itself
Well, I actually wouldn't recommend AppleScript for the average user at all. I would recommend they try to find a solution that already exists or dive into learning Automator first before tackling a programming language of any kind.
Uninstall an AppleScript application from within Itself
I'd consider myself more skilled than the average user, but I didn't even know you could run OS X without the Finder (or Path Finder or something.) How do you quit the Finder without logging off? It just relaunches when you kill/force quit...
Uninstall an AppleScript application from within Itself
I have a "Quit Finder" menu item, just like any other application, that I added to the end of the Finder menu using the following defaults command:
defaults write com.apple.finder QuitMenuItem 1 ; killall Finderor you can use a basic AppleScript: tell application "Finder" to quitYou should consider yourself extremely lucky that you don't run into more bugs in the Finder. I have 5 open bug report tickets with Apple at the moment regarding Finder bugs alone! Like I said before, the Finder is decent but has a long way to go still!
Uninstall an AppleScript application from within Itself
interesting. again, out of curiosity, what are the Finder bugs you're seeing? I'd like to see if I can replicate them.
Uninstall an AppleScript application from within Itself
From user point of view, Finder has some bugs, but every version has been better. In Mac OS X 10.4 Finder there is the horrible lack of refresh, when some other app added something to a folder. The Finder can even be AppleScripted to refresh, but it didn't work.
From scripter's point of view, the Finder has a learning curve, but it is more understandable and reliable than e.g. System Events scripting. Thanks to tedw for nice Finder scripting.
The same:
It is valid System Events scripting. It doesn't work in spite of file scripting possibilities with System Events. When saved as an app and then run from AppleScript Editor in 10.6 it shows buggy behavior.
Besides, term "me" has changed meaning a little between Mac OS X 10.4 and 10.6. In the latter it means the script app, in the older the Script Editor, when run from the Script Editor. Have your backup ready if trying! The example shows one of AppleScript's flaws, the varying terminology in same task between apps.
|
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysNo new commentsLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.14 seconds |
|