Intento convertir por lotes las páginas a texto sin formato, pero sigo teniendo problemas con los permisos de archivos. (Usando Sierra 10.2.3 después de actualizar desde 10.2.2)
el nombre de archivo no se pudo exportar. No tienes permiso.
Dos métodos hasta ahora:
on run
tell application "Finder"
set mfolder to "Macintosh HD:Users:me:Documents:convertme:"
set theFiles to name of every file of folder mfolder
end tell
set theFolder to "Macintosh HD:Users:me:Documents:converted:"
tell application "Pages"
activate
repeat with aFile in theFiles
open aFile
set sourceFolder to POSIX path of aFile
set newsourceFolder to characters 1 thru -8 of sourceFolder as string
set theFolder to newsourceFolder & ".txt"
export front document to POSIX file theFolder as unformatted text
close front document
end repeat
end tell
end run
También se probó con Automator: en Solicitar elemento del buscador
function run(input, parameters) {
inFile = Path( input );
outFile = Path( input.toString().replace(/\.[^\.]+$/, '.pdf') );
pages = Application('Pages');
document = pages.open( inFile );
pages.export(document, {to: outFile, as: 'PDF'});
pages.close(document, {saving: 'no'});
return outFile;
}
Permisos en la carpeta configurados para: todos leen y escriben