Is There a way to command..to open and close a CD tray?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
- Posts: 203
- Joined: Mon Oct 31, 2011 9:36 pm
- Location: Italy
- Contact:
Is There a way to command..to open and close a CD tray?
Is There a way to command..to open and close a cd?
i need a solution cross-platform at least for window10 and mac os x for livecode community.....
I s there an easy way??? i know...livecode do not do....why???
Thanks a lot in advance,
Lestroso
i need a solution cross-platform at least for window10 and mac os x for livecode community.....
I s there an easy way??? i know...livecode do not do....why???
Thanks a lot in advance,
Lestroso
Re: Is There a way to command..to open and close a cd?
Buonasera Lestroso,
what exactly do you mean with "open and close a cd"?
To "open" a card you need to "go to cd xyz" and to "close" it you need to go to another card or close the stack. Is that what you are looking for? Of course this can be scripted.
Best
Klaus
what exactly do you mean with "open and close a cd"?
To "open" a card you need to "go to cd xyz" and to "close" it you need to go to another card or close the stack. Is that what you are looking for? Of course this can be scripted.
Best
Klaus
Re: Is There a way to command..to open and close a cd?
Something like this?
Code: Select all
on rawKeyDown pKey
--F1
if pKey is "65470" then
go to next card
--or go to card "card name"
else
pass rawKeyDown
end if
end rawKeyDown
"Det bästa stället att hitta en hjälpande hand är i slutet av din egen arm" förutom här
Re: Is There a way to command..to open and close a cd?
I believe he means a 'cd/dvd player', not a cd(card). I could be wrong though.
-
- Posts: 203
- Joined: Mon Oct 31, 2011 9:36 pm
- Location: Italy
- Contact:
Re: Is There a way to command..to open and close a cd?
Yes, bogs, i'm sorry...you're right....
i need a command to eject the cd inside the computer..is there a manner cross platform?? thanks a lot..
i saw the trick...launch the applescript to do that...ok but in windows??? ok....in addition the launch command don't work....
thanks a lot...
lestroso
i need a command to eject the cd inside the computer..is there a manner cross platform?? thanks a lot..
i saw the trick...launch the applescript to do that...ok but in windows??? ok....in addition the launch command don't work....
thanks a lot...
lestroso
-
- Posts: 203
- Joined: Mon Oct 31, 2011 9:36 pm
- Location: Italy
- Contact:
Re: Is There a way to command..to open and close a cd?
This applescript works fine! how i can launch this?? the command "launch" don't open any app!!!
i have made an app from this code....manually ok work but i f put a button and the script launch don't work...
Best regards,
Lestroso
i have made an app from this code....manually ok work but i f put a button and the script launch don't work...
Code: Select all
tell application "Finder"
eject (disks whose ejectable is true)
end tell
Lestroso
Re: Is There a way to command..to open and close a cd?
I believe what you are going to wind up using is "shell" function, probably within an if/then or case/switch statement (since you'll have to issue different command line functions based on windows/mac), but maybe someone else has actually played with ejecting cds/dvds and will know better.
Re: Is There a way to command..to open and close a cd?
AHA!
OK, on the Mac you can use shell to open and close the CD try:
Tested and works!
Since this is still listed in the dictionary you could try this on Windows:
No idea if and how it will work if you have more than one CD/DVD device attached to your machine.
Best
Klaus
OK, on the Mac you can use shell to open and close the CD try:
Code: Select all
...
## Open:
get shell("drutil tray eject")
...
## Close:
get shell("drutil tray close")
...
Since this is still listed in the dictionary you could try this on Windows:
Code: Select all
...
## Open:
get MCISendString("set cdaudio door open")
...
## Close
get MCISendString("set cdaudio door closed")
...
Best
Klaus
-
- Posts: 203
- Joined: Mon Oct 31, 2011 9:36 pm
- Location: Italy
- Contact:
Re: Is There a way to command..to open and close a cd?
thank a lot klaus.... i'll try your code...thanks again...
cheers!
Lestroso
cheers!
Lestroso
-
- Posts: 722
- Joined: Thu Sep 11, 2014 1:49 pm
- Location: The Netherlands
Re: Is There a way to command..to open and close a CD tray?
For Windows you may find the answer in the link below in combination with using the 'get shell' or 'get MCISendString' commands in livecode as the great Klaus suggested .
https://superuser.com/questions/972447/ ... le_rich_qa
Never tried it myself so you have to experiment
Regards,
Paul
https://superuser.com/questions/972447/ ... le_rich_qa
Never tried it myself so you have to experiment
Regards,
Paul
-
- Posts: 203
- Joined: Mon Oct 31, 2011 9:36 pm
- Location: Italy
- Contact:
Re: Is There a way to command..to open and close a CD tray?
Dear friends,
i have tryed this script for Mac os x in a button :
This works very fine!!!! Now i will try for windows...Thanks a lot to everybody!!!
Best regards,
Lestroso
i have tryed this script for Mac os x in a button :
Code: Select all
on mousedown
## Open:
get shell("drutil tray eject")
end mousedown
Best regards,
Lestroso
Re: Is There a way to command..to open and close a CD tray?
That's what I meant with "Tested and works".Fasasoftware wrote: ↑Fri Apr 06, 2018 12:42 pmThis works very fine!!!!Code: Select all
on mousedown ## Open: get shell("drutil tray eject") end mousedown