Hello Bernd,
Thanks for the reply. The name of the drive is "RTN-2012" which is a network volume. I have many apple scripts using the same and similar paths. This path works fine when run from the Applescript editor, it only has an issue when run from LiveCode using Applescript, the shell or osa from shell passing the commands as arguments. Other scripts that I pass are working fine, but for some reason, LiveCode is inserting new lines into this path "RTN-2012:0212-RTN:RTN-022712:PNJ-022712:PNJ21012:". I have altered the Applescript to :
Code: Select all
put "" into field "dealList"
put "tell application " & QUOTE & "Finder" & QUOTE into line 1 of field "dealList" --& CR & tab &
put "activate" into line 2 of field "dealList" --& CR & tab &
put "set aPath to " & QUOTE & completePath & QUOTE & " as string" into line 3 of field "dealList"
[b]put "display dialog aPath" into line 4 of field "dealList"[/b] <<<<<<<<<<----------------- Change inserted here
--put "open folder aPath" into line 4 of field "dealList" --& CR &
put "end tell" into line 5 of field "dealList"
do field "dealList" as "appleScript"
This returns
RTN-2012:0212-RTN:RTN-022712
:PNJ-022712
:PNJ21012:
in a dialog box. This does not look like a word wrap problem because there is plenty of space on line two for the entirety of line three.
Hi mwieder,
Here is the code I am using to build the path. For this function I am pulling a 6 character start date from an AS400 database. The dealNumber is supplied by the user.
Code: Select all
put "" into completePath --put "/Volumes/" into completePath
put ":" into pathDelimiter
put char 1 to 3 of word 1 of field "dealNumber" into pathRegion
put char 1 to 8 of word 1 of field "dealNumber" into pathDealNumber
put URL ("xxtp://xxxxx.markettechmedia.xom/CustomerData.aspx?dealNumber=" & field dealNumber) into dealData
set the itemDelimiter to "|"
put last item of line 1 of dealData into startDate
put char 1 to 2 of startDate & char 5 to 6 of startDate into mmyyStartDate
put "-20" & char 5 to 6 of startDate into yyyyStartDate
if char 1 of word 1 of field "dealNumber" is "P" then
put "RTN" into theProductType
else if char 1 of word 1 of field "dealNumber" is "A" then
put "ADCART" into theProductType
end if
if theProductType is "RTN" then
put completePath & theProductType & yyyyStartDate & pathDelimiter & mmyyStartDate & "-" & theProductType & pathDelimiter & theProductType & "-" & startDate into completePath
put completePath & pathDelimiter & pathRegion & "-" & startDate & pathDelimiter & pathDealNumber & pathDelimiter into completePath
end if
The logic is sound because I can open files within the folder from within LiveCode, just not the folder itself.
And I would love to know if there is another method for opening the folder in the Finder or Explorer so that I do not need to use a script at all.
Thanks for the reply's. I am excited about some of the things I will be able to do with LiveCode, just have to get over the learning hump.
Robert