In windows I right click and then there is an option to create a text file.
How to do so in mac?
|
In windows I right click and then there is an option to create a text file. How to do so in mac? |
|||
|
|
|
You can also do this in Terminal. Go to the directory where you want to create the file, then run the following:
|
|||||||
|
|
There's two ways to do this, the easiest is the first option;
Export the script as an Application somewhere safe and make sure you tick Run Only when saving it. Then drag the resulting file to the toolbar in Finder This will then allow you to create a blank text file in what ever window you're viewing in Finder called The Ultimate Beginner’s Guide To AppleScript, is good if you want to know more about AppleScript. |
||||
|
|
|
I use PathFinder as a replacement for Finder and it includes this in its right-click context menu. It is prboably too expensive a solution just for this but if you want to have a better Finder for other reasons as well. |
|||
|
|
|
You could also assign a shortcut to a script like this:
Or make an Automator service:
The service doesn't show up in the context menu if the input type is no input. And there is a bug in 10.7 and 10.8 where the shortcuts for services don't always work until you hover over the services menu from the menu bar. |
|||
|
|
|
There are two useful utilities that you can download and install that will enable you to create a new text file (or RTF file) in a currently-open folder that you are viewing using the Finder. The utilities are called NewTextFileHere and NewRTFHere and can be downloaded from http://mac.softpedia.com/developer/Jonas-Wisser-37498.html Icons for either of these apps can then be included on all of your Finder windows. |
|||
|
|
|
Here's my script for creating new files from a store of templates. I run it with FastScripts using a keyboard shortcut, but you can save it to an applet and put it in the menu bar, create an automator action, etc. -ccs
----------------------------------------------------------------------------
-- Author: Christopher Stone
-- Created: 2012-10-26 : 01:27
-- Modified: 2012-10-26 : 18:26
-- Application: Finder
-- Purpose: Create a new file from a file-type list in the front Finder window using
-- : template files stored in a folder.
-- Dependencies: Template files provided by the user.
-- Templates: Auto-creates a Text template - others are for the user to supply.
----------------------------------------------------------------------------
try
try
set templateFolderPath to ((path to application support from user domain as text) & "Script_Support:New_File_Here!:")
set templateFolder to alias templateFolderPath
on error
set newFilesHereFolder to quoted form of (POSIX path of templateFolderPath)
set textTemplate to newFilesHereFolder & "Text_Template.txt"
do shell script "mkdir -p " & newFilesHereFolder & ";
touch " & textTemplate & ";
open -R " & textTemplate
return
end try
tell application "Finder"
if front window exists then
set winTarget to target of front window as alias
set fileTemplateList to name of files of templateFolder
tell me to set fileType to choose from list fileTemplateList with title "New_File_Here! Templates" with prompt ¬
"Pick One or More:" default items {get item 1 of fileTemplateList} with multiple selections allowed
if fileType ≠ false then
set AppleScript's text item delimiters to (return & templateFolderPath)
set itemsToCopy to paragraphs of ((templateFolder as text) & fileType)
repeat with i in itemsToCopy
set i's contents to i as alias
end repeat
set copiedFiles to duplicate itemsToCopy to winTarget
select copiedFiles
end if
else
error "No windows open in Finder!"
end if
end tell
on error e number n
set e to e & return & return & "Num: " & n
tell me to set dDlg to display dialog e with title "ERROR!" buttons {"Cancel", "Copy", "OK"} default button "OK"
if button returned of dDlg = "Copy" then set the clipboard to e
end try
----------------------------------------------------------------------------
|
|||
|
|