Re: Trying to script the creation of a script
Re: Trying to script the creation of a script
- Subject: Re: Trying to script the creation of a script
- From: Paul Berkowitz <email@hidden>
- Date: Sun, 22 Feb 2004 16:02:30 -0800
On 2/22/04 3:26 PM, "Christian Boyce" <email@hidden> wrote:
>
I'm trying to make a droplet script that makes another script. The
>
second script would be customized, based on the name of the file
>
dropped. I've gotten as far as creating the new Script Editor document
>
automatically, with text as desired, but I haven't figured out how to
>
pass the name of the dropped file to the new script.
>
>
Here's what I have:
>
>
on open thefile
>
tell application "Finder"
>
set y to thefile as alias
>
set thename to the name of y
>
end tell
>
>
tell application "Script Editor"
>
activate
>
--this is where we create the text that makes up the script.
>
--it is also where the problem lies.
>
set x to "tell application \"2.0TitleTrack Jukebox\" of machine
>
\"eppc://192.168.1.100\"
>
Stop
>
Clear
>
end tell
>
--
>
tell application \"Finder\" of machine \"eppc://192.168.1.100\"
>
open file\" & thename & \"of folder \"TitleTrack Jukebox v2.0\" of
>
startup disk
>
end tell
>
--
>
tell application \"2.0TitleTrack Jukebox\" of machine
>
\"eppc://192.168.1.100\"
>
activate
>
Set Loop true
>
Play
>
end tell"
>
--now we make the script
>
make new document with properties {text:x}
>
end tell
>
end open
>
>
>
What happens is I create a script that's absolutely perfect, except
>
that the variable "thename" is shown as "thename" and not as what
>
"thename" actually stands for. That is, I want the value of "thename"
>
to be shown in the script, not literally "thename."
You never took 'thename' out of your literal string. This section:
--
tell application \"Finder\" of machine \"eppc://192.168.1.100\"
open file\" & thename & \"of folder \"TitleTrack Jukebox v2.0\" of
startup disk
end tell
--
should be:
--
tell application \"Finder\" of machine \"eppc://192.168.1.100\"
open file\"" & thename & "\"of folder \"TitleTrack Jukebox v2.0\" of
startup disk
end tell
--
with quotes around " & thename & " to remove it from your large literal
quote.
--
Paul Berkowitz
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.