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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
thread Thread Starter Forum Replies Last Post
how to make an iso into a img (does not work as an .iso) mud25 Mac Basics and Help 2 Jul 19, 2011 09:30 PM
How to make an applescript to delete iTunes duplicates? darkmaster87 Mac Programming 10 May 8, 2010 05:47 PM
How to quit an app in OS 4.0? nano8blazex iPhone 90 Apr 8, 2010 08:13 PM
Create AppleScript to quit an application minutes after startup MrCheeto Mac Programming 0 Jan 25, 2010 10:01 AM
Do you need an iPhone to submit an app? Locker iPhone/iPad Programming 6 Jan 21, 2009 03:57 AM


All times are GMT -5. The time now is 07:33 AM.

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

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