Same system, same code, diff. Macs, diff. results

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
pderks
Posts: 58
Joined: Sat May 14, 2011 4:25 pm

Same system, same code, diff. Macs, diff. results

Post by pderks » Sat Jul 09, 2016 6:08 pm

Hi,

I have built a stack, that gathers a list of '.scpt' and '.applescript' file paths from hard disk, then creates a new card for each file and finally pastes the files' script into the card's devoted field.

This succeeds with Mac Book Pro 17'' (Mid 2009), but fails with Mac Pro (Mid 2010). On both machines work Mac OS X 10.11.5 (El Capitan) and LiveCode 8.0.0 Build 13018.

LiveCode part

Code: Select all

…
repeat with ii = 1 to the Number of lines in AS_FileList
   put line ii of AS_FileList into FileLine
   create card
   put "set AS_FilePath to" && q(revMacFromUnixPath(FileLine)) into line 2 of AppleScript_Code
   do ASS as AppleScript
   select before fld "AS_Archivist_Script"
   paste 
end repeat
…
AppleScript_Code

Code: Select all

tell application "Script Editor"
set AS_FilePath to "HardDisk/Folder 1/Folder 2/pdAS_FileLister•jpg.scpt"
   set myScript to open AS_FilePath
   activate
   tell application "System Events"
      tell process "Script Editor"
         click menu item "Alles auswählen" of menu "Bearbeiten" of menu bar 1 -- "Select all" of "Edit"
         click menu item "Kopieren" of menu "Bearbeiten" of menu bar 1        -- "Copy"       of "Edit"
      end tell
   end tell
   close myScript
end tell
Any hint is welcome

Peter

andrewferguson
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 184
Joined: Wed Apr 10, 2013 5:09 pm

Re: Same system, same code, diff. Macs, diff. results

Post by andrewferguson » Tue Aug 02, 2016 1:45 pm

What do you mean by "fails"? Does it crash, or just produce the incorrect results.

If it is the applescript causing the failure, can you run that by itself in Mac's 'Automator' tool? Does that work?

Post Reply