Scripts

From UA Libraries Digital Services Planning and Documentation

(Difference between revisions)
Jump to: navigation, search
Line 29: Line 29:
----
----
'''On Making Scripts Work on Mac OSX:'''
'''On Making Scripts Work on Mac OSX:'''
-
''
 
-
*Associating Scripts on the MAC''
 
-
**To associate files with particular software , CTRL-click on the file.
+
''Associating Scripts on the MAC''
-
**Choose “open with”. If that isn’t available, choose “open”.
+
*To associate files with particular software , CTRL-click on the file.
-
**In the Enable box, set the value to “All Applications”.
+
**Choose "open with". If that isn’t available, choose "open".
-
**Check the “Always Open With” box.
+
**In the Enable box, set the value to "All Applications".
 +
**Check the "Always Open With" box.
**Select Utilities>Terminal
**Select Utilities>Terminal
-
**And click “Open” and you should be good to go.
+
**And click "Open" and you should be good to go.
-
''
+
''*Running Scripts''
-
*Running Scripts''
+
*Since the MACs come with Perl and Python pre-installed they are essentially run from the command line by double clicking on the file name, although manually launching them from the terminal should work as well.
-
**Since the MACs come with Perl and Python pre-installed they are essentially run from the command line by double clicking on the file name, although manually launching them from the terminal should work as well.
+
**For example:
**For example:
$ python foo.py
$ python foo.py
Line 48: Line 46:
**In the second case the script AND in the case of double-clicking the script filename, the script would have to include the appropriate shebang line, for example '''#!/usr/bin/python''' for Python scripts and '''#!/usr/bin/perl''' for Perl scripts.
**In the second case the script AND in the case of double-clicking the script filename, the script would have to include the appropriate shebang line, for example '''#!/usr/bin/python''' for Python scripts and '''#!/usr/bin/perl''' for Perl scripts.
- 
***This will allow the MACs to know where to locate Python and Perl, respectively.
***This will allow the MACs to know where to locate Python and Perl, respectively.
- 
***If for some reason this doesn't work, make sure the script is saved with a UNIX style byte order so that the shebang will be read properly by the MAC.
***If for some reason this doesn't work, make sure the script is saved with a UNIX style byte order so that the shebang will be read properly by the MAC.
****A good text editor like Notepad ++ (Windows) easily allows one to make these changes to text files. Alternately, saving the file on a Linux or MAC OS station should do the trick.
****A good text editor like Notepad ++ (Windows) easily allows one to make these changes to text files. Alternately, saving the file on a Linux or MAC OS station should do the trick.

Revision as of 21:36, 10 November 2010

All software available from this site uses the Creative Commons BSD License; the license template is available here.


For EADs

For ETDs

For Quality Control

For Uploading Content

For Getting PURLS

For Archiving

For Creating Derivatives

Items in books

Cabaniss_Software (For the Cabaniss NHPRC project)

Mass_Content_Software (for mass digitization of collection materials to be linked to from finding aid, without manually-created item level metadata)

For Getting batch information about your files

Counting stuff



On Making Scripts Work on Mac OSX:

Associating Scripts on the MAC

  • To associate files with particular software , CTRL-click on the file.
    • Choose "open with". If that isn’t available, choose "open".
    • In the Enable box, set the value to "All Applications".
    • Check the "Always Open With" box.
    • Select Utilities>Terminal
    • And click "Open" and you should be good to go.


*Running Scripts

  • Since the MACs come with Perl and Python pre-installed they are essentially run from the command line by double clicking on the file name, although manually launching them from the terminal should work as well.
    • For example:
  $ python foo.py
  $ ./foo.py
    • In the second case the script AND in the case of double-clicking the script filename, the script would have to include the appropriate shebang line, for example #!/usr/bin/python for Python scripts and #!/usr/bin/perl for Perl scripts.
      • This will allow the MACs to know where to locate Python and Perl, respectively.
      • If for some reason this doesn't work, make sure the script is saved with a UNIX style byte order so that the shebang will be read properly by the MAC.
        • A good text editor like Notepad ++ (Windows) easily allows one to make these changes to text files. Alternately, saving the file on a Linux or MAC OS station should do the trick.
Personal tools