The run ��� mac os x

The run ��� mac os x

By Rob LeFebvre • 6:00 am, November 7, 2012

Ever want to run multiple copies of a program at the same time? Yeah, me neither. But when I ran across this tip, I thought, hey, that’d be pretty cool. I could run two copies of Calculator on the same Mac. At the same time! Or even something like NetNewsWire, running one instance of the app that uses one Google account, and a second instance of the app that uses a different account. Pretty neat, right? But how? It sounds complicated. The word “instance” sounds complicated.

Turns out, it’s really fairly simple. Let’s try it out.

Launch the AppleScript Editor, first of all. I know! AppleScript can be scary. But trust me, this is cool. You’ll find this in the Utilities folder, which is nestled in your Applications folder. Once it’s launched, you’ll see an Untitled editing window. Copy and paste the following into the empty window:

do shell script «open -n «

Next, make the Finder active by clicking on the little happy face icon on the left of your Dock. Open the Applications folder, and choose an app you want to run two (or more!) instances of. I chose NetNewsWire. Click and drag that app over to the empty AppleScript editor window, and drop it just to the left of that final quotation mark in the line above, giving you:

do shell script «open -n /Applications/NetNewsWire.app»

Now, click on the Scripts menu at the top of your screen, and choose Compile. Or just hit Command-K on your keyboard. Then choose Save from the File menu, and be sure to change the file type to “Application.” Save it on the Desktop for now.

Once you’ve saved the new app, you can double click on it over and over to launch multiple instances of the app you just chose. Some apps won’t work, like iTunes, but many will. Give it a try and let us know how it goes in the comments below.

Источник

Running script upon login mac [closed]

Want to improve this question? Update the question so it’s on-topic for Stack Overflow.

Closed 8 years ago .

I am wondering if anyone is able to help me out with getting a .sh file to run when I log in to my account on my computer. I am running Mac OS X 10.6.7.

I have a file «Example.sh» that I want to run when I log onto my computer. I do not have a problem running it when I am already logged in, but I want this to run automatically.

3 Answers 3

  • start Automator.app
  • select Application
  • click Show library in the toolbar (if hidden)
  • add Run shell script (from the Actions/Utilities )
  • copy & paste your script into the window
  • test it

save somewhere (for example you can make an Applications folder in your HOME, you will get an your_name.app )

go to System Preferences -> Accounts -> Login items

EDIT:

I’ve recently earned a «Good answer» badge for this answer. While my solution is simple and working, the cleanest way to run any program or shell script at login time is described in @trisweb’s answer, unless, you want interactivity.

With automator solution you can do things like next:

so, asking to run a script or quit the app, asking passwords, running other automator workflows at login time, conditionally run applications at login time and so on.

tl;dr: use OSX’s native process launcher and manager, launchd .

To do so, make a launchctl daemon. You’ll have full control over all aspects of the script. You can run once or keep alive as a daemon. In most cases, this is the way to go.

  1. Create a .plist file according to the instructions in the Apple Dev docs here or more detail below.
  2. Place in

/Library/LaunchAgents

  • Log in (or run manually via launchctl load [filename.plist] )
  • For more on launchd , the wikipedia article is quite good and describes the system and its advantages over other older systems.

    Here’s the specific plist file to run a script at login.

    Updated 2017/09/25 for OSX El Capitan and newer (credit to José Messias Jr):

    Replace the after the Program key with your desired command (note that any script referenced by that command must be executable: chmod a+x /path/to/executable/script.sh to ensure it is for all users).

    Run launchctl load

    /Library/LaunchAgents/com.user.loginscript.plist and log out/in to test (or to test directly, run launchctl start com.user.loginscript )

    Tail /var/log/system.log for error messages.

    The key is that this is a User-specific launchd entry, so it will be run on login for the given user. System-specific launch daemons (placed in /Library/LaunchDaemons ) are run on boot.

    If you want a script to run on login for all users, I believe LoginHook is your only option, and that’s probably the reason it exists.

    Источник

    Upgrade to macOS Big Sur

    macOS Big Sur elevates the most advanced desktop operating system in the world to a new level of power and beauty. Experience Mac to the fullest with a refined new design. Enjoy the biggest Safari update ever. Discover new features for Maps and Messages. Get even more transparency around your privacy.

    Chances are, your Mac can run macOS Big Sur

    The following models are supported:

    • MacBook (2015 or later)
    • MacBook Air (2013 or later)
    • MacBook Pro (Late 2013 or later)
    • Mac mini (2014 or later)
    • iMac (2014 or later)
    • iMac Pro (2017 or later)
    • Mac Pro (2013 or later)

    To see which model you have, click the Apple icon in your menu bar and choose About This Mac.

    Make sure you’re ready to upgrade.

    Before you upgrade, we recommend that you back up your Mac. If your Mac is running OS X Mavericks 10.9 or later, you can upgrade directly to macOS Big Sur. You’ll need the following:

    • OS X 10.9 or later
    • 4GB of memory
    • 35.5GB available storage on macOS Sierra or later*
    • Some features require an Apple ID; terms apply.
    • Some features require a compatible internet service provider; fees may apply.

    Upgrading is free and easy

    Upgrading from macOS Catalina 10.15 or Mojave 10.14?

    Go to Software Update in System Preferences to find macOS Big Sur. Click Upgrade Now and follow the onscreen instructions.

    Upgrading from an older version of macOS?

    If you’re running any release from macOS 10.13 to 10.9, you can upgrade to macOS Big Sur from the App Store. If you’re running Mountain Lion 10.8, you will need to upgrade to El Capitan 10.11 first.

    If you don’t have broadband access, you can upgrade your Mac at any Apple Store.

    General Requirements

    • OS X 10.9 or later
    • 4GB of memory
    • 35.5GB available storage on macOS Sierra or later*
    • Some features require an Apple ID; terms apply.
    • Some features require a compatible internet service provider; fees may apply.

    Mac Hardware Requirements

    For details about your Mac model, click the Apple icon at the top left of your screen and choose About This Mac. These Mac models are compatible with macOS Big Sur:

    • MacBook (2015 or later)
    • MacBook Air (2013 or later)
    • MacBook Pro (Late 2013 or later)
    • Mac mini (2014 or later)
    • iMac (2014 or later)
    • iMac Pro (2017 or later)
    • Mac Pro (2013 or later)

    Feature Requirements

    Requires a broadband internet connection and microphone (built-in or external).

    Hey Siri

    Supported by the following Mac models:

    • MacBook Pro (2018 or later)
    • MacBook Air (2018 or later)
    • iMac Pro (2017 or later)

    Dictation, Voice Control, and Voice Memos

    Requires a microphone (built-in or external).

    Spotlight Suggestions

    Requires a broadband internet connection.

    Gestures

    Requires a Multi-Touch trackpad, Force Touch trackpad, Magic Trackpad, or Magic Mouse.

    Force Touch gestures require a Force Touch trackpad.

    VoiceOver gestures require a Multi-Touch trackpad, Force Touch trackpad, or Magic Trackpad.

    Photo Booth

    Requires a FaceTime or iSight camera (built-in or external) or USB video class (UVC) camera.

    FaceTime

    Audio calls require a microphone (built-in or external) and broadband internet connection.

    Video calls require a built-in FaceTime camera, an iSight camera (built-in or external), or a USB video class (UVC) camera; and broadband internet connection.

    Apple TV

    High dynamic range (HDR) video playback is supported by the following Mac models:

    • MacBook Pro (2018 or later)
    • iMac Pro (2017 or later)
    • Mac Pro (2019) with Pro Display XDR

    Dolby Atmos soundtrack playback is supported by the following Mac models:

    • MacBook Air (2018 or later)
    • MacBook Pro (2018 or later)

    Sidecar

    Supported by the following Mac models:

    • MacBook (2016 or later)
    • MacBook Air (2018 or later)
    • MacBook Pro (2016 or later)
    • Mac mini (2018 or later)
    • iMac (late 2015 or later)
    • iMac Pro (2017 or later)
    • Mac Pro (2019)

    Supported by all iPad models with Apple Pencil support:

    • 12.9-inch iPad Pro
    • 11-inch iPad Pro
    • 10.5-inch iPad Pro
    • 9.7-inch iPad Pro
    • iPad (6th generation or later)
    • iPad mini (5th generation)
    • iPad Air (3rd and 4th generation)

    Continuity Camera

    Requires an iPhone or iPad that supports iOS 12 or later.

    Continuity Sketch and Continuity Markup

    Requires an iPhone with iOS 13 or later or an iPad with iPadOS 13 or later.

    Handoff

    Requires an iPhone or iPad with a Lightning connector or with USB-C and iOS 8 or later.

    Instant Hotspot

    Requires an iPhone or iPad with cellular connectivity, a Lightning connector or USB-C, and iOS 8.1 or later. Requires Personal Hotspot service through your carrier.

    Universal Clipboard

    Requires an iPhone or iPad with a Lightning connector or with USB-C and iOS 10 or later.

    Auto Unlock

    Requires an Apple Watch with watchOS 3 or later or an iPhone 5 or later.

    Approve with Apple Watch

    Requires an Apple Watch with watchOS 6 or later or an iPhone 6s or later with iOS 13 or later.

    Apple Pay on the Web

    Requires a MacBook Pro or MacBook Air with Touch ID, an iPhone 6 or later with iOS 10 or later, or an Apple Watch with watchOS 3 or later.

    Phone Calling

    Requires an iPhone with iOS 8 or later and an activated carrier plan.

    Requires an iPhone with iOS 8.1 or later and an activated carrier plan.

    Requires an iPhone with iOS 12 or later and a configured Home app.

    AirDrop

    AirDrop to iOS and iPadOS devices requires an iPhone or iPad with a Lightning connector or with USB-C and iOS 7 or later.

    AirPlay

    AirPlay Mirroring requires an Apple TV (2nd generation or later).

    AirPlay for web video requires an Apple TV (2nd generation or later).

    Peer-to-peer AirPlay requires a Mac (2012 or later) and an Apple TV (3rd generation rev A, model A1469 or later) with Apple TV software 7.0 or later.

    Time Machine

    Requires an external storage device (sold separately).

    Maps electric vehicle routing

    Requires an iPhone with iOS 14 and a compatible electric vehicle.

    Maps license plate restrictions

    Requires an iPhone running iOS 14 or an iPad running iPadOS 14.

    Boot Camp

    Allows Boot Camp installations of Windows 10 on supported Mac models.

    Exchange Support

    Requires Microsoft Office 365, Exchange 2016, Exchange 2013, or Exchange Server 2010. Installing the latest Service Packs is recommended.

    Windows Migration

    Supports OS X 10.7 or later and Windows 7 or later.

    App Store

    Available only to persons age 13 or older in the U.S. and many other countries and regions.

    Photos

    The improved Retouch tool is supported on the following Mac models:

    • MacBook Pro (15-inch and 16-inch models) introduced in 2016 or later
    • iMac (Retina 5K models) introduced in 2014 or later
    • iMac (Retina 4K models) introduced in 2017 or later
    • iMac Pro (2017 or later)
    • Mac Pro introduced in 2013 or later

    Источник

    How can I get a script to run every day on Mac OS X?

    10 Answers 10

    For reference, all 3 options would work. The iCal option however has more limitations than the others.

    (There are GUIs for editing cron and launchd as mentioned in other answers)

    Cron is the most straight forward and well known and there are many tutorials available. The Coles Notes is to add the last line from below to your crontab (either by editing /etc/crontab or using crontab on the command line):

    In Mac OS X, cron has actually been replaced by launchd but launchd is backwards compatible with cron meaning you can still use cron but it’s actually launchd doing all the work.

    If you want to use launchd you’ll want to check out other questions here on Super User as well: (eg. How do I run a launchd command as root?) as to where you want to save your configuration file (the plist file) as when it runs depends on what directory it is stored in and how it’s loaded (eg. whether you used sudo or not) — similar to cron.

    A sample run daily launchd plist (be sure the file and and the label are the same — minus the plist for the label) follows — this script is run everyday at 3 minutes past midnight:

    It’s also worth noting that launchd tasks if they were scheduled for when the computer is asleep or off, they will run when the computer becomes available again (turning it on or waking it up) — though only once no matter how many days it may have been. Edit: I just was at an Apple document that said that if the machine is off, then you will lose any launch events during that time, (your script will not launch on startup), (sleep does launch script on waking up)

    Another option is to use «at» (check manual page with «man at»). The script can reschedule itself with e.g.:

    (use «+ 10 minutes» instead of «tomorrow» to run it every 10 minutes; to stop scheduling, just do «at -l» to list the scheduled job ids and then «at -r id» to remove the job)

    You may have to start the corresponding daemon (atrun) first with (see https://superuser.com/a/43680):

    Advantages: quick fix, no sudo/root access needed, easy to do complicated schedule patterns Disadvantage: not standard scheduling method for OS X (which is launchd)

    Источник

    Читайте также:  Виджеты mac os big sur для windows
    Оцените статью