-
Tree Command For Mac카테고리 없음 2020. 3. 22. 18:25
As the late, great Agatha Christie wrote: I don’t think necessity is the mother of invention — invention, in my opinion, arises directly from idleness, possibly also from laziness. To save oneself trouble.
As I was working on my MacBook Pro, adjacent to a less attractive (and currently off) PC, I decided to run. As purveyors of fine (or bland) economic experiments will know, z-Tree is currently Windows only. As I am too lazy and disinterested in my PC to fire it up and run z-Tree on it, I decided to get it running on my Mac and share with you how easy it actually is. Preparation We will be installing Xcode, Command Line Tools, MacPorts, and Wine. So, if you have any of these installed feel free to skip the relevant sections.
This tutorial assumes you have a copy of ztree.exe and zleaf.exe. If you do not have these files, you will need to request them via snail-mail using the license contract or find a friend with a copy. Step 1: Install Xcode EDIT: If you are on OS X 10.6, follow the instructions for Snow Leopard Step 2: Install Command Line Tools. Click “Install” to install the Command Line Tools.
Open Xcode. Select the menu option “Xcode - Preferences ” or press Command+,. Click the “Downloads” tab. Under “Components” click on “Install” on the line for “Command Line Tools” Step 3: Install MacPorts Using makes it a snap to download and install open-source software on OS X. Download the MacPorts “pkg” for your OS X version (I tested this while running Mountain Lion). After downloading the MacPorts “pkg”, install MacPorts with the default settings.
Step 4: Install Wine allows you to run Windows applications within OS X (and Linux) without requiring a copy of Microsoft Window. Open a terminal: either. press Command+Space, type “ terminal“, then press Return/ Enter,. or open Launchpad, and find Terminal in the “Other” group or type “ terminal“, then press Return/ Enter. Enter the following command: sudo port install wine-devel.
Enter your password and wait. This will take a while.
Step 5: Run z-Tree Open a terminal, navigate to the folder containing “z-tree.exe” (i.e., use “ cd“) and enter the following command: wine ztree.exe This will launch the z-Tree program. (Optional) Step 6: Setup a shortcut to z-Tree. Open Automator (open Launchpad, and find Automator in the “Other” group or type “ automator“, then press Return/ Enter). Select “Application” and click “Choose”.
Tree Like Command For Mac
Select “Run Shell Script”. Replace “cat” with /opt/local/bin/wine /path/to/ztree/ztree.exe Be sure to change “/path/to/ztree/” with the actual path to your copy of “ztree.exe”. Test your application by clicking “Run” (the play button in the top-right corner). If it works as expected, save your application as “zTree” in the Applications folder. ZTree can now be launched just as you would any other application. (Optional) Add z-Tree icon to Automator Application. Download a 512×512 z-Tree icon.
Open “Finder”. Click “Downloads” on the left (assuming that’s where you saved the file) and double-click the file “ztree.hqx”. Click on the newly created “ztree” icon file. Press Command+C to copy the icon. Click “Applications” on the left and find “zTree”.
Control-Click or right-click (or two-finger-click) the “zTree” application. Select “Get Info”.
Click on the Automator logo near the top (it will get a blue halo). Click the icon near the top-left.and press Command+V to paste the icon. Now you have zTree running in Mac and it looks native!
(Optional) Step 7: Start zleafs for testing To run a zleaf for testing purposes enter the following command into a terminal while in the directory containing zleaf.exe: wine zleaf.exe /name test1 where “ test1” is the name you assign to the zleaf. You can then create another zleaf by changing “ test1” to “ test2” in order to test a 2-subject experiment. (Optional) Automate zleaf.
Open Automator (open Launchpad, and find Automator in the “Other” group or type “ automator“, then press Return/ Enter). Select “Application” and click “Choose” as in step 6. Type “ ask” where your cursor is (in the search field that says “Name”). Double-click on “Ask for Text”. For “Question”, type “ Type a name for this zleaf.“. Leave “Default Answer” blank. Check “Require an answer”.
Change the text “OK” to “Launch zleaf”. Type “ shell” where your cursor is (in the search field that says “ask”). Double-click the “Run Shell Script” option. Change “to stdin” to “as arguments”. Replace “ cat” with /opt/local/bin/wine /path/to/ztree/zleaf.exe '$@' Be sure to change “ /path/to/ztree/” with the actual path to your copy of “zleaf.exe”.
Your Automator should look like this. Test your application by clicking “Run” (the play button in the top-right corner). If it works as expected, save your application as “zLeaf” in the Applications folder. (Optional) Automate the launching of multiple zleafs For an application that launches multiple zLeafs at once, replace the above shell command (the section that used to say “ cat“) with the following: for i in $(seq 1 $@) do /opt/local/bin/wine /path/to/ztree/zleaf.exe /name 'Player $i' & done Again, remember to replace “ /path/to/ztree/” with the actual path to your copy of “zleaf.exe”. You should also change the prompt in the “Ask for Text” section to something like “ How many zLeafs would you like to run?“. I also changed the “Default Answer” to “ 1“.
Save this application as “zLeafs”. (Optional) Add z-Leaf and z-Leafs icons To change the icons follow the instructions above and use the following icons:. 512×512 z-Leaf icon. 512×512 z-Leafs icon. Concluding Remarks I hope my efforts will help some of you.
Mac List Directory
Please let me know if you have any questions or problems related to this tutorial in the comments section below. Thanks for the help 🙂 I am still encountering errors unfortunately. Specifically, when I enter the code like you said: /opt/local/bin/wine “/Users/nichola/Documents/ZTree/z.tree.exe” I get an error message saying: To test this application within Automator, add the “Get Specified Finder Items” action to the beginning of your workflow. Remove or disable the action before running the workflow outside of Automator.
I tried doing that but still getting a generic error message as follows: The action “Run Shell Script” encountered an error. Check the actionʼs properties and try running the workflow again.
Ubuntu Tree Command
Any ideas why this might be?? I am using the /bin/bash option for the Shell and it passes input to stdin. Do I need to get the specified finder items like Automator says to before I run the script? Or is that unnecessary? Thanks for any help you might be able to provide. Actually, in order to run multiple Zleafs I use a program that a colleague of mine made.
The link is on this page: Just download the file under “Launch z-Leafs with GUI (executable).” Move that file to the Zleaf and ZTree directory. Then set up like Jonathan showed for part 6.
But you will use /Users/nichola/Documents/ZTree/LaunchZleafsWin.exe instead of /Users/nichola/Documents/ZTree/z.tree.exe Then, after you have ZTree open, you can open multiple ZLeaf windows. The first time you run the LaunchZleafsWin.exe you will need to specify where the Zleaf.exe file is. Hope that works.