MACSCRPT Archives

December 2009

MACSCRPT@LISTSERV.DARTMOUTH.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Chris Harbinson <[log in to unmask]>
Reply To:
Macintosh Scripting Systems <[log in to unmask]>
Date:
Tue, 15 Dec 2009 07:11:01 +0000
Content-Type:
text/plain
Parts/Attachments:
text/plain (126 lines)
Learned a lot from this.

Dropping the POSIX path and going for file was the first breakthrough,  
as suggested by Mark Lively.

Is there an advantage to using POSIX path?

Then Ed chimed in with his useful paths script.

Now John has me dragging folders into my script editor window. I'm  
using Script Debugger Version 3 (hope Mark Aldritt's not listening!),  
which is still going very strong and provides an alias when a folder  
is dropped into it .

The time and typing I could have saved myself!

It'll be better next time! Thank you all...

Chris

> ------------------------------
>
> Date:    Mon, 14 Dec 2009 12:20:21 -0800
> From:    "Stockly, Ed" <[log in to unmask]>
> Subject: Re: Load script setback (was I'm still Chris etc...)
>
> Sounds like you're manually typing your paths in.
>
> Here's a better way to get a valid reference to put into your script:
>
> Run this script in Script Editor.  Navigate to the script you want  
> to load
> into your script. When the dialog comes up, copy and paste the  
> contents into
> your script.
>
> -----------
>
> Set myScriptFile to choose file
>
> Display dialog "Copy and paste this text into your script" default  
> answer
> myScriptFile as text
>
> -------------
>
>
> Inside your script I'd suggest this:
> --------
> Set myScript to ""-- paste the path here
>
> Set myScript to myScript as alias -- this command will fail if the  
> file
> reference is no good
>
> Load script myScript
> -----------
>
> I'd also suggest not pasting the path into your script, but  
> assigning it to
> a property whose value is set when the script is first run, or if  
> the file
> gets moved:
>
> Property pathToScript:""
>
> Try
> Set pathToScript to pathToScript as alias
> On error
> Set pathToScript to choose file
> End
>
> HTH,
>
>
> HTH
>
> ES
>
>
>
> Date:    Mon, 14 Dec 2009 23:54:09 +0000
> From:    John Delacour <[log in to unmask]>
> Subject: Re: Load script setback (was I'm still Chris etc...)
>
> At 12:20 -0800 14/12/09, Stockly, Ed wrote:
>
>> Sounds like you're manually typing your paths in.
>>
>> Here's a better way to get a valid reference to put into your script:
>>
>> Run this script in Script Editor.  Navigate to the script you want  
>> to load
>> into your script. When the dialog comes up, copy and paste the  
>> contents into
>> your script [...]
>
>
> In Smile, if you drag the file (say the Scripts Folder) from the
> Finder to the script window you will get
>
>         alias "Mac Mini:Library:Scripts"
>
> In Script Editor, if you drag the folder to the script window, you
> will get an apparently superfluous dialog : whichever option you
> choose, you get
>
>         "/Library/Scripts"
>
> pasted into the window.
>
> This can be converted to something useful by doing this:
>
>         posix file "/Library/Scripts" as alias
>         --=> alias "Mac Mini:Library:Scripts:"
>
> ...or perhaps Script Editor has evolved in the direction of sanity
> since 10.4.11
>
> JD
>
> ------------------------------
>
> End of MACSCRPT Digest - 13 Dec 2009 to 14 Dec 2009 (#2009-78)
> **************************************************************

ATOM RSS1 RSS2