01-23-2023, 09:57 PM
Pardon the ignorance of a newbie. I've been using QB64 off and on for years, I'm not really sure of it's relationship with QB64PE. I'm using what I think is the latest QB64 version 2.1, but I see the PE version is at 3.5.0?
Anyway, here is my issue:
Dragging and dropping into a BASIC program doesn't work on a Mac. So I have found it very useful to use the clipboard commands. I can easily find a file using Finder (the Mac equivalent of File Explorer) and copy it to the clipboard for my BASIC program to use. The problem I have is trying to extract the PATH information for the filename on the clipboard.
In Finder if you select files/folders, then right-click on them, you can copy them to the clipboard. But it doesn't copy the PATH information. But there is a way. Right-click on the files/folders. Instead of clicking on the "Copy" entry, hold down the [Option] key. "Copy" becomes "Copy as Pathnames". It copies the entire PATH and filename to the clipboard. If you are keyboard centric, use [Command]+[Option]+[C]. But there is a snag (bug?) with _CLIPBOARD$. It doesn't return all the data from the clipboard properly when there are file PATHs involved. Here is a simple program:
_CLIPBOARD$ = ""
PRINT "Copy the files to the clipboard."
DO UNTIL _CLIPBOARD$ <> ""
LOOP
CLS
PRINT _CLIPBOARD$
SLEEP
SYSTEM
If I select multiple files/folders in Finder, _CLIPBOARD$ returns all the titles (without the PATHs).
If I select multiple files/folders with their PATHs as described above, _CLIPBOARD$ only returns the first title. I know it contains all of them because I can paste to a blank document and they are all there with their PATHs.
For example, if I select the following files using “Copy Items”:
/Applications/QB64/Programs/File1.rtf
/Applications/QB64/Programs/File2.txt
/Applications/QB64/Programs/File3.pdf
_CLIPBOARD$ returns:
File1.rtf
File2.txt
File3.pdf
If I select them using “Copy Items As Pathnames”, _CLIPBOARD$ returns:
/Applications/QB64/Programs/File1.rtf
But if I paste the clipboard into a blank document I get:
/Applications/QB64/Programs/File1.rtf
/Applications/QB64/Programs/File2.txt
/Applications/QB64/Programs/File3.pdf
So I know the information is there, I just can't get to it. On a Mac the clipboard is loaded by either "Copy to clipboard" or "Copy path to clipboard", in either case QB64 should be able to read the contents of the clipboard.
Any help with this would be greatly appreciated...
Anyway, here is my issue:
Dragging and dropping into a BASIC program doesn't work on a Mac. So I have found it very useful to use the clipboard commands. I can easily find a file using Finder (the Mac equivalent of File Explorer) and copy it to the clipboard for my BASIC program to use. The problem I have is trying to extract the PATH information for the filename on the clipboard.
In Finder if you select files/folders, then right-click on them, you can copy them to the clipboard. But it doesn't copy the PATH information. But there is a way. Right-click on the files/folders. Instead of clicking on the "Copy" entry, hold down the [Option] key. "Copy" becomes "Copy as Pathnames". It copies the entire PATH and filename to the clipboard. If you are keyboard centric, use [Command]+[Option]+[C]. But there is a snag (bug?) with _CLIPBOARD$. It doesn't return all the data from the clipboard properly when there are file PATHs involved. Here is a simple program:
_CLIPBOARD$ = ""
PRINT "Copy the files to the clipboard."
DO UNTIL _CLIPBOARD$ <> ""
LOOP
CLS
PRINT _CLIPBOARD$
SLEEP
SYSTEM
If I select multiple files/folders in Finder, _CLIPBOARD$ returns all the titles (without the PATHs).
If I select multiple files/folders with their PATHs as described above, _CLIPBOARD$ only returns the first title. I know it contains all of them because I can paste to a blank document and they are all there with their PATHs.
For example, if I select the following files using “Copy Items”:
/Applications/QB64/Programs/File1.rtf
/Applications/QB64/Programs/File2.txt
/Applications/QB64/Programs/File3.pdf
_CLIPBOARD$ returns:
File1.rtf
File2.txt
File3.pdf
If I select them using “Copy Items As Pathnames”, _CLIPBOARD$ returns:
/Applications/QB64/Programs/File1.rtf
But if I paste the clipboard into a blank document I get:
/Applications/QB64/Programs/File1.rtf
/Applications/QB64/Programs/File2.txt
/Applications/QB64/Programs/File3.pdf
So I know the information is there, I just can't get to it. On a Mac the clipboard is loaded by either "Copy to clipboard" or "Copy path to clipboard", in either case QB64 should be able to read the contents of the clipboard.
Any help with this would be greatly appreciated...