I have a simple AppleScript Studio project that I have set up for slide shows etc. (I could use iPhoto/iDVD etc. but thanks to A.S.Studio Im having so much fun with making my own apps now that they can
t stop me) Anyway, I want to have the cursor property/visibility set to 0 so its not visible while the photo is showing, but I can
t seem to find the command or correct expression necessary.
So, the question is: What is the command to make the cursor not visible?
Thanks in advance.
I don’t know if it can be done using a tricky obj-c method, but you could take a look to:
http://www.osaxen.com/xtool.html
Which includes a command called “temp hide mouse”, which will “hide the mouse until next move”.
Wow, thanks for the eye opener. I guess I should have checked out this web sit beyond just this Forum as I didn`t even know about Scripting Additions. This opens up a whole new world of possibilities. Thanks.
I downloaded the “temp hide cursor” and though it looks like exactly what I want I cant quite figure out how to use it. I
ve tried just inserting it into my script as is but I get an error. Im assuming I
m missing a step. With the download there was also a plugin called “XTool.osax” that I imagine I must plug in somewhere. Does it go in the “Library-Application Enhancers folder?” Does that one plugin work for all scripting additions?
Any help would be greatly appreciated.
Thanks again in advance.
You may want check our FAQ section about Scripting Additions:
http://macscripter.net/faq/scripting_additions.php
Basically, you copy the scripting addition (or osax) into any ScriptingAdditions folder (inside the Library folder) in your system (except for the System folder, not recommended). Eg:
~/Library/ScriptingAdditions
/Library/ScriptingAdditions
/Network/Library/ScriptingAdditions
(if such folder doesn’t exist, just create it)
Then, you can use any of its commands in your system (eg, “temp hide cursor”).
If you distribute your app, your users must also install this scripting addition. You can also “bundle” the osax in your own app (if it is allowed by the osax’ license), as described in the FAQ “Can I include a scripting addition in my application?” (which also applies to AppleScript Studio apps).
Thank you JJ for the info. I know Im going to get this eventually, but I
m still missing something. Ok, I added a “ScriptingAdditions” folder inside the main library folder and inserted the plugin titled “XTool.osax”. I then added the “temp hide cursor” command into my script and just to be sure did a restart, but it always gives me the error message:
Expected “given”, “with”, “without”, other parameter name, etc. but found identifier. (-2741)
Im wondering wether you need a special call phrase to indicate to AppleScriptStudio that it
s a ScriptingAddition? To test it out I tried just setting up a simple button:
on clicked theObject
temp hide cursor
end clicked
but I still get the same error message. Is there a special command that goes before a ScriptingAddition?
Again, thanks in advance.
I introduced a typo accidentally in my last message. Try “temp hide mouse” instead of “temp hide cursor”.
You can see a list of available commands in the osax simply dropping it onto the Script Editor’s icon, or choosing it from Xcode’s menu “File > Open Dictionary…”.
“temp hide mouse” did the trick. It works like a charm. Thank you very much for getting me going with ScriptingAdditions.
Hey, JJ, are you still there? I was away on a business trip for a few days and wanted to ask you one last question. Since ScriptingAdditions is an Object-C workaround, is there any draw back to using them in AppleScript Studio applications? (Other than the fact you have to bundle them in and worry about copywrite issues etc.)
Is there a drawback in terms of speed and/or stability? As far as the program is concerned, is using them the exact same as if that particular command was written in standard applescript?
Look forward to hearing from you soon and again thanks in advance.
Scripting Additions are mostly solid rocks, absolutelly stable and very speedy (it’s C running!). When you use them, usually you must use them (eg, you want hide the cursor, and plain AppleScript can’t do it without third-party help; if you want check the keys pressed in the keyboard, you will use “keys pressed”, from Jon’s Commands; and so on).
Other example: you can search/replace text in plain AppleScript, but if you need regular expressions or other features (such as search/replace lists of texts, etc), you may take a look to the command “change” in the Satimage osax.
Usually, the most known limitation in osaxen is the “portability”: users hate installing stuff they don’t know what the hell is it. Now, you can bundle the osax in your product, so the installation part is gone. There are still some considerations, though. If the author of the osaxen doesn’t update his stuff regularly, it may stop working in any release of the OS or AS. And when the osax dies, your script dies. For example, there were two osax, called “Akua Sweets” and “Dialog Director” very powerful and used by lots of lots of folks in their scripts in pre-X days. Now, both are gone and there are lots of lots of interesting scripts you can’t use (much more if you considerate the great amount of dead osaxen in OS X).
Plain applescript code is much more easy to mantain.
But osaxen is allways worth the prize, as well as command-line tools, which can be considered the same: they are kinda plugins at all, to extend AS’ functionalities!
Thanks a million. I really do appreciate your valuable information.