Apple script is like javascript to call
QProcess from qt help you
This sample make a background image on Desktop....
//MacOSX
#elif defined(Q_OS_MACX)
//create script
QString scriptFilename
= ((Window
*)qApp
->mainWidget
())->getTitle
()->getAlbum
()->getTmpDir
() + "/tmpBackgroundScript";
QFile file( scriptFilename
);
if(file.open(IO_WriteOnly))
{
//-----
stream.setDevice( &file );
//-----
stream << "tell application \"Finder\"\n";
stream << "set pFile to POSIX file \"" << chosenFilename.ascii() << "\"\n";
stream << "set desktop picture to file pFile\n";
stream << "end tell";
}
file.close();
//run script to set background
p.addArgument( "/usr/bin/osascript" );
p.addArgument( scriptFilename );
p.start();
//if there is an old file remove it
if(!oldFilename.isNull())
{ tmpDir.remove( oldFilename ); }
//-------------------------------
//UNIX
#else
//MacOSX
#elif defined(Q_OS_MACX)
//create script
QString scriptFilename = ((Window*)qApp->mainWidget())->getTitle()->getAlbum()->getTmpDir() +
"/tmpBackgroundScript";
QFile file( scriptFilename );
if(file.open(IO_WriteOnly))
{
//-----
QTextStream stream;
stream.setDevice( &file );
stream.setEncoding( QTextStream::UnicodeUTF8 );
//-----
stream << "tell application \"Finder\"\n";
stream << "set pFile to POSIX file \"" << chosenFilename.ascii() << "\"\n";
stream << "set desktop picture to file pFile\n";
stream << "end tell";
}
file.close();
//run script to set background
QProcess p;
p.addArgument( "/usr/bin/osascript" );
p.addArgument( scriptFilename );
p.start();
//if there is an old file remove it
if(!oldFilename.isNull())
{ tmpDir.remove( oldFilename ); }
//-------------------------------
//UNIX
#else
To copy to clipboard, switch view to plain text mode
Python on qt is possibel show the source code from
http://www.scribus.net/ and grep python command
other way is QScriptEngine http://doc.trolltech.com/4.3/qscriptengine.html
IMO: Java class QT button not work on firefox 3.
Bookmarks