Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Special Interests > Visual Media > Design and Graphics

Reply
 
Thread Tools Search this Thread Display Modes
Old Apr 6, 2006, 08:39 PM   #1
Sharewaredemon
macrumors 68000
 
Sharewaredemon's Avatar
 
Join Date: May 2004
Location: Pitch forking mulch in Nova Scotia, Canada
Send a message via MSN to Sharewaredemon
Making an Applescript to quit an app

Ok guys, I have ZERO applescript experience.

I recently came upon the megaman effect and I want to make an automator action opens the app, and then quits it.

Opening the app will enable the effect.

There isn't an automator action to quit an application, but I figure applescript could handle that.

Could you guys help me out with that?
__________________
Meow.
Sharewaredemon is offline   0 Reply With Quote
Old Apr 6, 2006, 09:15 PM   #2
Laser47
macrumors 6502a
 
Laser47's Avatar
 
Join Date: Jan 2004
Location: Maryland
Quitting an app is very easy with applescript. Take my example of making applescript quit Safari
Code:
tell application "Safari"
	quit
end tell
__________________
iBook G4 14" 1.42ghz, 1.5gb RAM, 100gb 7200rpm Travelstar, 4G iPod 40gb
Laser47 is offline   0 Reply With Quote
Old Apr 6, 2006, 09:22 PM   #3
Sharewaredemon
Thread Starter
macrumors 68000
 
Sharewaredemon's Avatar
 
Join Date: May 2004
Location: Pitch forking mulch in Nova Scotia, Canada
Send a message via MSN to Sharewaredemon
Quote:
Originally Posted by Laser47
Quitting an app is very easy with applescript. Take my example of making applescript quit Safari
Code:
tell application "Safari"
	quit
end tell

hoora!

thanks a lot, it works!

as it turns out, this app needs to be running in order for it to work. Is there anyway to have an app run without it being visible in the dock?
__________________
Meow.
Sharewaredemon is offline   0 Reply With Quote
Old Apr 6, 2006, 09:37 PM   #4
Laser47
macrumors 6502a
 
Laser47's Avatar
 
Join Date: Jan 2004
Location: Maryland
I dont know how to make an app not show in the dock while running.
Also you can reduce the step of automaton opening the app by using this code
Code:
tell application "iTunes"
	run
end tell
__________________
iBook G4 14" 1.42ghz, 1.5gb RAM, 100gb 7200rpm Travelstar, 4G iPod 40gb
Laser47 is offline   0 Reply With Quote
Old Apr 6, 2006, 09:52 PM   #5
Sharewaredemon
Thread Starter
macrumors 68000
 
Sharewaredemon's Avatar
 
Join Date: May 2004
Location: Pitch forking mulch in Nova Scotia, Canada
Send a message via MSN to Sharewaredemon
Quote:
Originally Posted by Laser47
I dont know how to make an app not show in the dock while running.
Also you can reduce the step of automaton opening the app by using this code
Code:
tell application "iTunes"
	run
end tell
cool, thanks.

Oh well, I guess I might not notice the little megaman icon in the dock when I have this script run to surprise me....

Thanks for your help!
__________________
Meow.
Sharewaredemon is offline   0 Reply With Quote
Old Sep 20, 2010, 07:40 PM   #6
cal81985
macrumors newbie
 
Join Date: Sep 2008
I know this is like 4 years too late, but...

You can make an application invisible in the dock by right clicking (ctrl-click) on the application, selecting "Show Package Contents", and opening the Info.plist file within the "Contents" directory. If you don't have the Apple developer tools installed, you will have to do this in TextEdit. I'll assume you don't for this next step.

Once the plist file is opened, look for the "<dict>" tag. Do a search within the document if you have to, but it will almost always look like the following:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>

After you find where the <dict> tag starts, copy and paste this directly underneath:

<key>LSUIElement</key>
<true/>

Save the file and exit. Make sure there are no spaces between the lines to ensure this works!

If you have the developer tools installed, double clicking on the file should automatically open it up with Property List Editor. Once open, click on the dictionary menu ("Information Property List") and select "Add Child" from the toolbar. On the ensuing drop down menu, find "Application is agent (UIElement)" and select that as the key to use. Make sure the check box next to the key is checked, save the plist, and exit.

You can do that with any application. If you have trouble saving the plist file because of permissions issues, just save it as another plist file to your desktop (named Info.plist of course), then simply drag and drop into the "Contents" folder of the application to replace it.
cal81985 is offline   0 Reply With Quote

Reply
MacRumors Forums > Special Interests > Visual Media > Design and Graphics

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
I want a "Force Quit" button in "Shutdown timed out because (app) didn't quit" dialog moonman239 OS X Mavericks (10.9) 0 Mar 9, 2014 11:37 PM
General: Quit last app dasx Jailbreaks and iOS Hacks 4 Jan 12, 2014 04:40 PM
Applescript (List Force Quit Apps) Kyp Mac Programming 9 Oct 4, 2013 10:38 PM
Applescript activation after quit mauianne Mac Programming 8 Feb 12, 2013 04:11 PM
My script is making it impossible to quit an app it works with Mephistopelus Mac Programming 9 Oct 17, 2012 08:39 AM

Forum Jump

All times are GMT -5. The time now is 01:00 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC