[TxMt] TextMate vs Applescript

pascal@g ymostudio at gmail.com
Tue Mar 18 04:22:18 UTC 2008


Thank you for your quick answer.
You made few interesting points!
	- the "$" acts as a warning for me to re-assign a specific (client)  
name to the document. not a brilliant idea, which I will change
	- the "try/on" spilt is more to do with my lack of knowledge on  
Applescript: I have just adapted one found on a forum.

I am having difficulties implementing your suggestions, not having  
enough knowledge of the Applescript syntax; I mainly do html and css  
coding, and have adapted a script to my needs.

Would you mind to clarify or correct directly the full script below?
It would be much appreciated...

> set theFolder to choose folder with prompt "Create/Choose Client  
> Project folder"
> try
> 	set briefFolder to ((theFolder as text) & "Brief") as alias
> on error
> 	tell application "Finder"
> 	set briefFolder to (POSIX path of briefFolder) & "x.tasks"
> 	do shell script ("touch " & briefDoc & " ;mate " & briefDoc)
> end try
> tell application "Finder"
> 	set capturesFolder to make new folder at theFolder with properties  
> {name:"Captures"}
> 	set processedFolder to make new folder at theFolder with properties  
> {name:"Processed"}
> 	set HiResFolder to make new folder at processedFolder with  
> properties {name:"High-Res Images"}
> 	set LoResFolder to make new folder at processedFolder with  
> properties {name:"Low-Res Images"}
> 	set trashFolder to make new folder at theFolder with properties  
> {name:"Trash"}
> end tell

PS: what are the details of your book?
--
cheers, Pascal



On 18/03/2008, at 11:26 AM, Dr. Drang wrote:

> On Mon, Mar 17, 2008 at 8:32 PM, pascal at g <ymostudio at gmail.com> wrote:
>>
>> the principle of the script was to create folders and sub-folders,  
>> then
>> create a new document in one of them with my text editor, save it  
>> with a
>> title, bringing it to the front for entry.
>
> If you delete everything after the 'tell application "Finder"'  
> clause and insert
>
>    set briefDoc to (POSIX path of briefFolder) & "$.tasks"
>    do shell script ("touch " & briefDoc & "; mate " & briefDoc)
>
> it should do what you want. I have to say that the use of a dollar
> sign as a file name scares me a bit because it's a special character
> in the shell, but with this change the script worked for me.
>
> (I am curious why the creation of the Captures folder isn't put into a
> 'try/on error' block like the  creation of the Briefs folder, but I'm
> sure you have your reasons.)
>
>> I have posted an entry on MacScripter, to hear that TextMate was  
>> "poorly
>> scriptable, even Standard Suite is badly implemented".
>> any solution to contradict that?!
>
> TextMate is certainly not as AppleScriptable as BBEdit, but it is far
> more scriptable with Perl, Python, Ruby, and the shell. In my book,
> this is a big win for TextMate and the reason I switched a couple of
> years ago.
>
> -- 
> Dr. Drang
>
> ______________________________________________________________________
> For new threads USE THIS: textmate at lists.macromates.com
> (threading gets destroyed and the universe will collapse if you don't)
> http://lists.macromates.com/mailman/listinfo/textmate

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macromates.com/textmate/attachments/20080318/0415b0ae/attachment.html>


More information about the textmate mailing list