Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4123700
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T23:38:41+00:00 2026-05-20T23:38:41+00:00

Can you create an Mac OS X Service with Python? How ? What I

  • 0

Can you create an Mac OS X Service with Python? How ?

What I want to do is to know hook my Python-fu to the service system provided by Mac OS X.
Anyone knows how? If yes any working code snippet? Will work only on text or also on a given mimetype – defined object?

Service Popup

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T23:38:42+00:00Added an answer on May 20, 2026 at 11:38 pm
    • Open Automator.app and create a new service.

    • Select “Utilities” from the left-hand actions list, then drag the “Run Shell Script” action into the workflow.

    • Choose /usr/bin/python as your shell.

    • Type some python. For example:

    :

    import sys
    
    for f in sys.stdin:
         print "Hello World: " + f,
    
    • Save the service as, say, “Test”

    • Try it out in TextEdit.app. Type some text, select the text, then choose TextEdit -> Services -> Test from the menu. It should prepend “Hello World: ” to each line of the text (as per the python code for f in sys.stdin)

    The above example works with text. Presumably, it could be modified to work with other data types provided through the OS X Services system.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Anyone knows how can I create a connection without help of IP? Something like
You can create a shell script or a Python or Ruby script and run
Working with MonoTouch .NET for iPhone and SQLite on Mac OSX. I can read
Using which softwares and framework we can create iPhone apps, without owning a MAC
Does Mail.app (Mac) have an API where developers can create plugins for Mail? I'm
On Mac OS X, you can create a zip archive from the Finder by
How can I create a hard link to a directory in Mac OS X? This feature
I want to create a Mac OS X style Dock Bar to be placed
I can't hear any sound in my Android Simulator in my Mac. Some times,
I know in bash we can create subshells using round parenthesis ( and )

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.