I need to be able to read the 'version' of my application (aka Osirix) and compare it to an expected value. I know how to do the comparison but I am not sure how to read the version now.
I think I could do this by reading it from the Get Info window, or reading it from the Version column in Finder/Application column
I cannot seem to find examples to modify for either option
set ReadAppVersion to value of version of application "Osirix"
Simply delete value of
set ReadAppVersion to version of application "Osirix"
Related
How to get NSImage.Name.cautionName
in AppleScriptObj.
I tried:
set cautionName to aN of NSImage.Name
but that does not work.
It looks like what you are after is NSImageNameCaution, which is a constant for the name of a system image. Your example (and link) appear to be using Swift, changing the documentation language to Objective-C gives you the proper term.
AppleScriptObjC uses names from the Objective-C documentation (it also does not use dot notation), so it would be something like:
use AppleScript version "2.4" -- Yosemite (10.10) or later
use framework "AppKit"
use scripting additions
# get the name
set imageName to (current application's NSImageNameCaution) as text
# get the image
set theImage to current application's NSImage's imageNamed:(current application's NSImageNameCaution)
It needs pipes to indicate that it is method
set cautionName to (anImage's |name|()) as text
NOTE: if the Image has not the associated name, then of course you will get missing value.
I have upgraded to recent WATIR(7.0.0.beta5) and when I am executing the following line
#browser.windows.last.use
I am getting this error
"indexing not reliable on WindowCollection"
This was working fine in my previous WATIR version(6.19.1). What is the issue?
Another question is, It looks like there are plenty of changes of capabilities. Do I have to set page_load_timeout and read_timeout separately now? and also I have read open_timeout, I don't know what it is for, Can someone help me understand what it is?
Drivers are not guaranteed to always return windows in the same order, so it has been decided to deprecate accessing windows based on their index (ie position in the Array of windows). You have a couple of options.
Working with 2 windows
If you are only working with 2 windows (probably most cases), the recommendation is to use 2 new methods:
# Switch to the second window that was opened
browser.switch_window
# Return to the first window
browser.original_window
Working with 3+ windows
The best approach would be to locate the window you want based on known properties:
# By url
browser.window(url: /closeable\.html/).use
# By title
browser.window(title: 'closeable window').use
# By an element in the window (new)
browser.window(element: browser.a(id: 'close')).use
(Not Recommended) By index
This is not recommended, but if you insist on using index, you can cheat by forcing the WindowsCollection to an Array:
browser.windows.each.to_a.last
I have a parameter for which I'm showing a prompt. I've set a default value for it and that works fine.
What doesn't work, however, is that if I choose to enter a different value when running the build, then on the next build this value automatically becomes the new default value, so to say.
I'd like the default value to always be fixed and if you enter a different value in the field, then that value will be used just for this build (and the next build will fallback to the fixed, default value for this parameter).
Is this possible and how can it be done?
Currently it's not possible. The related request is https://youtrack.jetbrains.com/issue/TW-21453, please vote. As of now you can use "Reset" link.
As far as I know, there's no built-in solution for this.
To solve your problem, you could use a Command Line (or Powershell) Build Runner that runs as the last step of the build. There you can reset your parameter by setting it to the desired default value using this as script content:
##teamcity[setParameter name='your.parameter' value='desiredDefaultValue']
I would recommend using a separate parameter to save desiredDefaultValue instead of a hard-coded value.
After continuous search on google, I still can't seem to figure out this problem with app inventor 2.
My question is how can I write to text file as initial value without user input. For example I want to store '6' as the initial value in a text file, there are ways to do it by clicking on button but is there a way to store the initial value without getting the user to enter a value? Also would this value be available each time the app is run? or would I need to set the initial value each time?
Many Thanks in advace
is there a way to store the initial value without getting the user to
enter a value?
Normally you would use a variable to store an initial value. You do not have to store that in a file! But if you like to use a file, you can use the Screen.Initialize event
see also the documentation of the File component
Also would this value be available each time the app is run?
yes, but only if the user did not delete the file manually...
or would I need to set the initial value each time?
Please first do the tutorials to lean the basics of App Inventor!
I'm trying to create a new input method using Input Method Kit. The documentation is very lacking, but I believe I'm setting the project up correctly and I place the input method into ~/Library/Input Methods after building it. However, I see strange behavior when looking at the list of input sources in Language & Text preferences.
The NumberInput sample seems to work fine for me, and there are no differences in my new input method that I can find, aside from the values for tsInputMethodIconFileKey, InputMethodConnectionName, InputMethodServerControllerClass, and CFBundleIdentifier in Info.plist. But I'm seeing these issues:
When I use my desired bundle identifier for the app, nothing shows up in the list. (This bundle ID doesn't exist anywhere else on my system.)
Changing the bundle identifier to be the same as the NumberInput sample makes it show up in the list, but when I select it, it sometimes duplicates entries in the list, and generally behaves weirdly.
As I make slight modifications to the bundle identifier, it seems to behave normally, but once I change it back to the original identifier (the desired one) it disappears from the list.
If I quit the process associated with my input method, selecting it in the menu again doesn't relaunch it.
Does anyone have any idea what's going on? Apple's documentation for IMKit is nearly nonexistant and it doesn't seem like many people have documented their own attempts at making input methods. Is there something I'm missing?
Thanks in advance!
P.S. Yes I've tried logging out and back in and even restarting my computer, nothing seems to significantly change the behavior I mentioned above.
This worked for me. Try this: make sure your bundle identifier contains "inputmethod" somewhere in the path. Example "com.blugs.inputmethod.IPAPalette". Yes AFAIK it's totally undocumented. Yes the documentation is awful. Hope this helps! Cheers.
The accepted answer here is very useful, adding .inputmethod. to your Bundle ID.
I'll add that I found a bit of documentation for this in TextInputSources.h, which contains a large number of comments and documentation not found in the Input Method Kit overview docs. Worth a read.
Carbon > Frameworks > HIToolbox > TextInputSources.h
In the Info.plist file, the value for the CFBundleIdentifier key must be a string that includes ".keyboardlayout."; typically this might be something like "com.companyname.keyboardlayout.MyKeyboardLayouts" (Before Leopard, it was required to be a string that began "com.apple.keyboardlayout", even for keyboard layouts not supplied by Apple).
and
If this key is not specified, an InputSourceID will be constructed by combining the BundleID with an InputModeID suffix formed by deleting any prefix that matches the BundleID or that ends in ".inputmethod."