File Object, copy and move commands are broken on macOS?

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.
  • Hey Yves I may have found a missing feature of the file object on Mac. The exporter can create a folder, can write and read files but won't copy or move any file.

    Notice that in the example below, it will create a "data2" folder but won't perform the copy command.


    Please login to see this attachment.

    Thanks

  • Hey Yves I may have found a missing feature of the file object on Mac. The exporter can create a folder, can write and read files but won't copy or move any file.

    Notice that in the example below, it will create a "data2" folder but won't perform the copy command.


    Please login to see this attachment.

    Thanks

    Hi there SevenSails,

    This is not a bug, it's a quirk of how Mac applications work. On Macs, the application itself can act as an accessible directory. So, the Apppath$ variable on Mac actually points INSIDE of the application (mac_wallp_test.app), not to the directory that the executable is contained in. If you were to save data using something like the INI Object, right click your application, click "Show Package Contents", and navigate to "Contents/Resources/," you would see the INI file tucked right inside the application, or "package".

    This means to perform actions in the directory that your application is actually located in, and not the application itself, you will need to use ../ in your path names after the Apppath variable in order to exit out of the application's directory and in to the directory that the application is actually located in. Here's how that would be done:

    Apppath$ + "../data/wallp1.png"


    Also, your initial file copy action was written incorrectly, so it won't work on any platform. When you define the destination path, you also have to include the file name of the copied file in that path, which could just be the same name or something different:

    Please login to see this attachment.


    Of course though, using ../ in your path on Windows machines will mess up the application, since the application itself cannot be its own directory on Windows. So, you will need to include different, runtime-specific events for your file operations. You can do this by cloning the events and adding an additional runtime check condition to them so that only one set will execute depending on the platform. You can find the condition that tests what runtime the application is running under by going to "Special --> Runtime --> Is running as.." in the New Condition menu.

    Please login to see this attachment.


    I've attached an updated example to this post. I hope all of this helps.

    Please login to see this attachment.

  • Thanks for you help, toby!
    You helped me out in Discord channel and I can confirm it's a bug on 294. In 293 it works fine.

    No problem! Just to clarify for the thread here, everything I outlined in my previous response works fine if Build 293.10 is used, but does not when Build 294 is used. Something related to file copying on Mac seems to have been broken at some point between Build 293.10 and Build 294.x (not sure which version specifically).

    Test Machines:
    Mid-2011 iMac (MacOS Sierra 10.12.6)
    Late 2014 Mac Mini (MacOS Monterey 12)

    Edited 3 times, last by tobydavis: change title (May 30, 2023 at 7:42 AM).

  • I will check and let you know

    thanks Fernando. I updated early today in Discord, it's probably my fault but even in build 293 I'm not getting File object to copy from a data folder no matter where the data folder is. I tried to reference data folder with either ../, ./ or just / it won't copy. No matter if data folder is in desktop as well, or anywhere inside the application folder. In one of the options it ask for permission but doesn't copy. Even if application folder and data folder are in desktop there is no way I'm getting the app to copy the file to documents/game folder. Only works if copy from documents to documents. Ideally it should copy that png from inside the app folder, not a data outside the app folder.

    Please login to see this attachment.

  • thanks Fernando. I updated early today in Discord, it's probably my fault but even in build 293 I'm not getting File object to copy from a data folder no matter where the data folder is. I tried to reference data folder with either ../, ./ or just / it won't copy. No matter if data folder is in desktop as well, or anywhere inside the application folder. In one of the options it ask for permission but doesn't copy. Even if application folder and data folder are in desktop there is no way I'm getting the app to copy the file to documents/game folder. Only works if copy from documents to documents. Ideally it should copy that png from inside the app folder, not a data outside the app folder.

    Please login to see this attachment.

    the change that is affecting this, is one made in 2017, I will add a fix and let you know in discord for you to try.

    =================================

    Quote

    * Start of Frame
    + Is running as Mac application
    bk : Load Apppath$ + "data/wallp1.png" into Animation Stopped, Direction ............, Frame #0, HotSpot(100000,100000), Action Point(100000,100000), Transparent Color RGB(255,0,192)

    note that the path have being change since path are relative to the one used for embedded data as posted in data elements - binary data XXXXX\data\wall1.png


    Now in your example you are copying from data\ to data2, but data doesn't exist, is a mere reference for embedded file, for this let me see if I can add something

    Quote

    * User clicks with left button on copy button
    + Is running as Mac application
    File : Create the directory Apppath$ + "data2"
    File : Copy Apppath$ + "data/wallp1.png" to Apppath$ + "data2/wallp1.png"

    Regards,


    Fernando Vivolo

    ... new things are coming ...

    Edited 3 times, last by Fernando (May 30, 2023 at 6:13 PM).

  • OK, i made some changes in MAC runtime and the file object, please contact me in Discord to organize a small test.

    Now this

    Quote

    * User clicks with left button on copy button
    + Is running as Mac application
    File : Create the directory Apppath$ + "data2"
    File : Copy "data/wallp1.png" to Apppath$ + "data2/wallp1.png"

    The new action copy, from file object, will check in embedded file system and make the copy accordingly (only copy action can do this, not the move or merge action)

    Regards,


    Fernando Vivolo

    ... new things are coming ...

    Edited 3 times, last by Fernando (May 31, 2023 at 1:43 AM).

  • OK, i made some changes in MAC runtime and the file object, please contact me in Discord to organize a small test.

    Now this


    The new action copy, from file object, will check in embedded file system and make the copy accordingly (only copy action can do this, not the move or merge action)

    thanks DM sent in Discord.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!