Change Soundtrack properties in QT 7 pro - Batch with applescript - audio

I need to change the soundtrack properties (movie properties tool in QT 7 pro) for a whole bunch of video files. The process would be:
in movie properties click on sound track
and then change the assignment of each audio channel from Mono to "center"
save the file(s)
I am completely unexperienced with Applescript but would it be possible to have a script that would automate that process so I can apply it to all the files without having to do it manually on each QT file?

Quicktime's Applescript support is very limited and the Dictionary only provides access to the most basic of functions (e.g., new movie, play, stop). File settings and properties are not exposed via the Applescript API. There might be something in the Cocoa frameworks, though that's a guess on my part.

Related

How should I create a desktop mockup?

I want to create a desktop mockup on Elementary OS 0.2. By "mockup" I mean something that shows off the aesthetic of the mockup, mostly just showing what selecting/clicking/hovering over a button or widget does to that particular part of the UI. I'm thinking about creating the various parts on GIMP and coding animation and transition logic into the final result. I know that something like this can be done in HTML/JS, but I want to avoid using those. Is there anything optimized for a project like this? I'm open to most languages.
Try WireframeSketcher wireframing tool. Unlike Gimp or PowerPoint, WireframeSketcher is designed specifically to help you create mockups and wireframes. It comes pre-packaged for Debian systems and can also be found in Software Center and so it works on Elementary OS too. Note that it's a commercial tool, but you can try it freely for 14 days.
Most PMs at large companies mock these things up using a presentation package like PowerPoint. If you know the routine and where to click it can look fantastic with minimal effort.
MockupUI does both wireframe and Windows native looking mockups. It uses your desktop's visual style which makes screens and widgets look as a standard Windows application. MockupUI lets you export screens as individual images, docx, pdf or html.
Actions/interactions can be explained by highlighting widgets and adding text annotations.

Tool to identify items in Qt interface

I'm trying to automate Skype on Ubuntu using LDTP which has a GUI that is written with Qt. LDTP requires that I know the names of the frames I'm interacting with and their objects. I don't have the Skype source code, but I was hoping there was some tool that might exist for extracting information about a Qt window or that it might at least confirm for me that automation is impossible for the window I'm trying to play with.
The reason I think this exists in the first place is that AutoIT had a similar application on Windows.
To find out if a window is able to be automated using LDTP, you can use the getapplist() and getwindowlist() functions as shown in the tutorial which can be found under doc on the github. To list the objects of this window, you can use getobjectlist().

Programmatically add keyboard shortcut to Mac System Preferences

If I go to System Preferences, Keyboard, Keyboard Shortcuts, then Application Shortcuts, I can define custom shortcuts to be used on a Mac.
Any way to access this functionality via Applescript?
The shortcuts are stored in NSUserKeyEquivalents dictionaries in ~/Library/Preferences/.GlobalPreferences.plist and the property lists of applications.
defaults write -g NSUserKeyEquivalents -dict-add Duplicate '~#d' Minimize '\0'
defaults write com.apple.finder NSUserKeyEquivalents '{"Show Package Contents"="#\r";}'
The shortcut format is described in the Cocoa Text System article.
System Preferences isn't scriptable with Applescript natively, you have to interact with it by GUI Scripting. GUI Scripting is really a last resort that allows you to interact with controls by explicitly declaring and calling them, and it doesn't take much to throw off a GUI script. It is difficult to implement even for experienced Applescript programmers. You'll find a few introductory tutorials out there in the web, but not much else.
The internals of the Mac OS are quickly becoming a lost art. Run the following in a shell, or run via shell in Applescript:
defaults write com.google.Chrome NSUserKeyEquivalents '{ "Search the Web…" = "#k"; }'
Also good to know: shortcuts for Services are in the pbs.plist, and they're stored using a different property than the NSUserKeyEquivalents.
There's info on how to write a basic script to change/add shortcuts for Services here:
Set Services keyboard shortcut via script OSX
This was the method I found the simplest, and it worked well for me (macOS 10.12.6 Sierra):
You can also use PlistBuddy and defaults:
/usr/libexec/PlistBuddy -c 'Delete NSServicesStatus:"(null) - test2 -
runWorkflowAsService"' ~/Library/Preferences/pbs.plist
2>/dev/null;defaults write pbs NSServicesStatus -dict-add '"(null) -
test2 - runWorkflowAsService"' '{key_equivalent = "^~#2";}'
The PlistBuddy command is not needed if there is not an existing entry
for the service. Replace test2 with the name of the service. Quit and
reopen applications to apply the changes.
^~#2 is control-option-command-2. See
http://osxnotes.net/keybindings.html.
And in case this might help those who are a bit less familiar with writing/executing scripts on macOS, I saved the script as a shell script (.sh extension), and ran it from Terminal using the following commannd:
sh "/path/to/script/scriptfile.sh"
I have written an AppleScript library to programmatically add Global & Application shortcuts. It took a tremendous amount of effort to work around the various quirks in how macOS implements shortcuts.
Version 1.0 is available here:
https://forum.latenightsw.com/t/setting-other-applications-keyboard-shortcuts-using-nsuserdefaults-defaults-not-updating/3537/5
I will be making some minor API additions & changes when I find the time, and will post the source code here in full at that time. Note that as mentioned above, Services shortcuts are stored using a completely different system & are not handled here.

Windows CE 6 Wordpad replacement

I'm developing a Win CE 6 OS image and want to make it fit in the "Windows Embedded CE 6.0 Core Run-Time License".
This means, among other things, that I have to remove the Wordpad application.
From a product service and development perspective I'd like to replace it with something similar but free.
One thought was to do a simple editor in C#/CF.Net but I'd rather like to find something which can be plugged in and works, preferable free or at least cheaper than the 15$ per unit a bumped up license would cost.
Is there any suitably licensed text editors out there which are available for Win CE 6?
I don't need a rich text editor just a simple text editor to edit xml and text configuration files. The editor must be able to handle utf-8/unicode.
cke is quite good and I'm sure you can make some kind of a deal with it's author. CEdit is another good one.
I ended up writing my own simple file editor in C#/WinForms. Not great, but gets the job done.

MP3 playback with dynamic tempo adjustment

I need to whip up a quickie app, something quick and dirty, on windows that lets a user control the tempo of a playing mp3 file with a slider.
Any recommendations on libraries/programming languages/controls that can make this easy?
I don't have control over the media choice (has to be mp3) or the platform (has to be windows)
Edit: Actually, I can convert the files to whatever format is necessary.
Windows Media Player v10+ has this built in. Take a look here. Isn't that what you need?
So far this is what I have found:
2xAV™ Plug-In For Windows Media Player®
Ideally, I would prefer something open source but if I can't find other options I'll give this a go.
You might take a look at this.
Edit: The WinMM.dll has a function called waveOutSetPlaybackRate (P/Invoke) which might be helpful as this DLL (which has been included with windows since Win 9x) can play MP3's. Here is some basic info on how to play the sounds using C#.

Resources