The Omni Group
These forums are now read-only. Please visit our new forums to participate in discussion. A new account will be required to post in the new forums. For more info on the switch, see this post. Thank you!

Go Back   The Omni Group Forums > OmniFocus > OmniFocus Extras
FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
Open or Create Project Folder Script Thread Tools Search this Thread Display Modes
Save this as a toolbar or menu script. Select a task, and it will open (if exists) or offer to create (if it doesn't) a folder in /Users/you/Projects for the Parent Project of the currently selected task.



Code:
set currentUser to do shell script "whoami"

set projectFolder to "/Users/" & currentUser & "/Projects/"

tell application "OmniFocus"
	try
		set selectedTask to value of selected tree 1 of content of window 1
	on error
		--nothing selected
		beep
		return
	end try
	
	if containing project of selectedTask is not missing value then
		set pName to name of containing project of selectedTask
		
		
		set projPath to projectFolder & pName
		
		try
			set ls to do shell script "ls " & quoted form of projPath
		on error
			display dialog "Folder does not exist, create it?" buttons {"Yes", "No"} default button 1
			if button returned of result is "Yes" then
				do shell script "mkdir -p " & quoted form of projPath
			else
				return
			end if
		end try
		
		
		do shell script "open " & quoted form of projPath
		
	end if
	
end tell
 
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Create matching folder in Mail for project raxtor OmniFocus 1 for Mac 0 2012-11-15 01:05 AM
AppleScript to create a Project inside a folder? RicardoSaporta OmniFocus 1 for Mac 10 2012-04-03 07:35 AM
How to I create a new folder and or project with mail rules? tlester OmniFocus 1 for Mac 2 2012-03-15 12:06 PM
Quick Entry: How to create a new project in a folder? u2mir OmniFocus 1 for Mac 10 2011-09-20 07:26 AM
Create project in folder by Cmd-Enter Schimmi OmniFocus 1 for Mac 1 2008-01-08 04:02 PM


All times are GMT -8. The time now is 03:07 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.