-
All replies
-
Helpful answers
-
Oct 14, 2015 2:03 PM in response to sefu1947by Old Toad,"Photos" app has a limited Standard Suite, where the "window" command is absent.
What do you mean by the window command? Is it the Windows menu that you're referring to?
Will "Photos" in the near future get a more extended Standard Suite?
Since we're all just users like yourself here we have no idea what's in Apples future. Tell Apple what missing features you'd like restored or new features added in Photos via https://www.apple.com/feedback/photos.html.
-
Oct 15, 2015 1:39 AM in response to Old Toadby sefu1947,Thanks for your reply. I will submit the matter to Apple and hope for the best .
The "window" command refers to AppleScript. Launch "Script Editor.app"; open "Window / Library". A list of scriptable apps opens, double click one of them (f.i. TextEdit; or add an app of your liking). Then you see the available commands:
At the bottom right you see "window". By this command you may order the position of a group of windows in a neat way (tiling). Unfortunately Photos lacks the majority of these commands. So, you have to resize and move this app manually, while other apps are repositioned by a button click.
-
Oct 15, 2015 7:32 AM in response to sefu1947by Jacques Rioux,Hi,
No window in Standard Suite of Photos on El Capitan.
So, you can use the GUI Scripting to set the bounds of window :
The ability to control the user-interface via AppleScript was determined by the state of a checkbox located in the Accessibility system preference pane, see this page --> http://www.macosxautomation.com/mavericks/guiscripting/index.html
Here is an example to set the bounds of an window :
----------------
set {x, y, h, w} to {0, 22, 500, 500}
set thisApp to "Photos"
try
tell application thisApp to set bounds of window 1 to {x, y, h, w} -- error on Photos or on some application
on error
tell application "System Events"
tell window 1 of process thisApp -- GUI Scripting
set size to {h, w}
set position to {x, y}
end tell
end tell
end try
----------------
-
Oct 17, 2015 9:32 AM in response to Jacques Riouxby sefu1947,Thank you for your explanation.
I was not aware that there is a difference between Apple scripting and Gui scripting. Anyhow, the scripts are quite similar.
My Accessibility System Preference Pane does not show an "Enable access for assistive devices" checkbox. But since Snow Leopard I use the terminal command:
do shell script ¬
"touch /private/var/db/.AccessibilityAPIEnabled" password "pwd" ¬
with administrator privileges
I guess this yields the same result.
I tried to add the GUI Scripting Applet, but did not find from where to obtain it. The "Script Editor.app" and the "systemUIServer.app" are checked.
I would welcome documentation about scripting, like a "Missing Manual for scripting". But I am afraid it does not exist.
Kind regards, Hans
-
Oct 18, 2015 7:20 AM in response to sefu1947by Jacques Rioux,Hi,
sefu1947 wrote:
Thank you for your explanation.
I tried to add the GUI Scripting Applet, but did not find from where to obtain it. The "Script Editor.app" and the "systemUIServer.app" are checked.
You must drag/drop your Applet in the "Security & Privacy" system preference pane.
The simplest is that (the system automatically adds (script, applet or application) in the preferences):
Run your applet.
The system show these windows.
Click on the "OK" button, and click on the "Open System Preferences" button.
After that, the system add the applet in the preference window ("tilingWindows.app" in my image).
You need to unlock the preference pane (need an administrator password) to check your applet's checkbox.
-
Oct 18, 2015 8:25 AM in response to Jacques Riouxby sefu1947,Hello Jacques,
Thanks for your extended explanation. In my case the way things turn out is a little bit different. Let me share my experience. My present situation allows me to apply scripts to scriptable apps and is defined by:
I want to mimic your advice, so I unchecked "Script Editor.app" and "SystemUIServer.app". In this way I hoped that your first two pictures would appear, so that I could proceed to the "Accessibility Inspector". But nothing happens after running my "tilingWindows" (no warning nor error message). After checking them again "tilingWindows" works as before.
Of course, non-scriptable apps are not effected. But "Photos" is scriptable, at least in a limited way. However, it generates the error message (added in the script myself).
Kind regards, Hans
-
Oct 18, 2015 4:06 PM in response to sefu1947by Jacques Rioux,Hello Hans,
sefu1947 wrote:
I want to mimic your advice, so I unchecked "Script Editor.app" and "SystemUIServer.app". In this way I hoped that your first two pictures would appear, so that I could proceed to the "Accessibility Inspector". But nothing happens after running my "tilingWindows" (no warning nor error message). After checking them again "tilingWindows" works as before.
Of course, non-scriptable apps are not effected. But "Photos" is scriptable, at least in a limited way. However, it generates the error message (added in the script myself).
"Accessibility Inspector" is an application from the Xcode bundle (developer tools), it is not necessary for your issue, but it is useful to inspect an UI element from an application (get attributes, actions and properties of an specific UI element, menu, button, textfield, table or other).
----
If your script is not an Applet (an AppleScript saved as Application) or an application made by Automator (an workflow which contains an AppleScript with GUI Scripting) :
If you run a script by selecting the script from the Script menu, you must check the "SystemUIServer.app" in "Security and Privacy" pane, that's all, you do not need anything more, see https://support.apple.com/en-us/HT202802
If you run a script from a third party utility, like Alfred, FastScript, Quicksilver or others, generaly you must grant access to this utility.
If you run the script from an Automator service, you must grant access to the application where you call this service.
There are other more complicated possibility as running a script with GUI Scripting in an osascript command from a shell script, which I do not know the answer.
-
Oct 19, 2015 3:53 PM in response to Jacques Riouxby sefu1947,Chapeau! The penny has dropped. I have made my first Applet. It is recognised by Accessibility and it is working for the regular scriptable apps:
For Photos I am going to implement the "on error" code according to your directive. I am confident that I will be able to do so.
Thanks again for your patience, Hans





