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
…
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
Peter