Applescript, VectorScript & VectorWorks
Applescript, VectorScript & VectorWorks
- Subject: Applescript, VectorScript & VectorWorks
- From: Dan Belfiori <email@hidden>
- Date: Thu, 21 Oct 2004 02:24:22 -0700
I've been struggling for quite a while with the following text problem.
Am I missing something obvious?
I'm using applescript to assemble and run VectorScripts (Scripting
language for VectorWorks)
The following script demonstrates the problem I can't solve.
--Begin applescript--------------------------
set TestList to {"Printer1", "Printer2"}
tell application "Printer Setup Utility" to set PrinterList to the name
of every printer
tell application "Finder" to set AppNames to the name of every
application process
AssembleScript(TestList) --this works
AssembleScript(AppNames) --this fails "VectorWorks got an error: Some
data was the wrong type."
AssembleScript(PrinterList) --this fails "VectorWorks got an error:
Some data was the wrong type."
on AssembleScript(SomeList)
set VWtext to "Procedure Test;" & return & "BEGIN" & return
repeat with anitem in SomeList
set VWtext to VWtext & "AlrtDialog('" & anitem & "');" & return
end repeat
set VWtext to VWtext & "END;" & return & "Run(Test);"
tell application "VectorWorks"
activate
DoScript VWtext
end tell
end AssembleScript
--end applescript-----------------------
When I paste the text of the failed script (captured from the
clipboard in handler AssembleScript above) in an applescript:
tell application "VectorWorks"
activate
doscript "<<pasted text>>"
end tell
the script succeeds!? something in the way the text is formatted in
variables and clipboard is fooling VW
db
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden