I have the following code which uses the terminal to return all items which are set to auto-start upon logging in:
Dim sh as New Shell
sh.Execute "osascript -e 'tell application ""System Events"" to get the name of every login item'"
Can someone please point me in the right direction as to how I now check (via Xojo code) for a specific item called test.app.
Thank you all in advance.
if Instr(sh.result,“test.app”)>0 then
Thanks Dave, but I need to check for a specific app, not just get a list of all items in the list
I’m presuming I need to somehow get a list of all the items which the Terminal returned, and then put then into an array - then check the array for the specific app’s name as a string?
Is that the best way of doing this?
If so - I need a little help with getting the returned list in to the array.
Richard. PLEASE READ THE ENTIRETY OF MY RESPONSE, that is EXACTLY what SH.RESULT does!
you want an array…
dim v() as string
you want to find ONE app
if Instr(sh.result,"test.app")>0 then'
I get the feeling you dismissed my solution, without even attempting to read, test or figure it out…
No, I never dismissed your solution?
All I can see from your previous post is msgbox sh.Result - which simply displays the list in a messagebox?
Thanks for your last response - now I have something to work with
[quote=307711:@Dave S]msgbox sh.Result
if Instr(sh.result,“test.app”)>0 then[/quote]
well this was my original response…
And no offsense Richard, but you seem to be smart enough to take a scrap and run with it… or so I thought
No offense taken Dave
It’s just that sometimes more knowledgeable developers seem to think that the person asking the question is being lazy, or want someone else to code it for them, (as one other particular member always seems to suggest whenever I post for help).
This is simply not the case (for me at least).
What seems blatantly obvious and ridiculously easy for the advanced developer, is often incomprehensible for someone with less knowledge.
It’s easy when you know what to look for in the LR, but if you have no idea, then it’s impossible
Thank you for your help - it is much appreciated.
Yes very interesting Michel - I didn’t expect anything less from you!
I rest my case.
Please block me - that way you do not keep having to read my posts.
dim v() as string
if result.IndexOf("text.app") > - 1 then
msgbox "test.app has been found"
Uh… isn’t that exactly what I posted an hour ago?
Yes it is Dave.
I think he just posted that, so that he could also add the sarcastic comment to the end of it.
Was that really necessary … should we also link to the forum etiquette? New year and all; maybe we could all display a little tolerance to begin the year … still have a good 360 days to go
I always try to help. Until I feel taken advantage of. Sorry.
Then IGNORE ME - that way you won’t get annoyed by my posts.
It’s not exactly hard, especially for a superior person such as yourself.
Strange how some demanding personalities take others for granted, to the point of hatred, when they don’t benevolently provide…
I will be the bigger person here and end this pointless conversation.
If you honestly believe that I want you to code my app for me - then so be it.
Gentlemen… calm down… this bickering is doing nobody (the two of you, and the rest of this community) any good, and there is no upside to this. Michel, if you are of the mindset you seem to be, simply ignore Richard in the future (to me that would be a petty response but I’m not to judge).
The question has been asked, and answered… so shake hands and lets all move on together