March 10, 20242 yr Commercial Member 11 minutes ago, ptimale said: because there is a bg.jpg file conflict Why is there a conflict? Which process is locking the file? When the file is locked, it doesn't matter what steps you take - you cannot rename or overwrite it. Edited March 10, 20242 yr by Lorby_SI LORBY-SI
March 10, 20242 yr Author when loading the plane the script is executed the image is renamed to bg.jpg but it is deleted
March 10, 20242 yr Commercial Member Just now, ptimale said: when loading the plane the script is executed the image is renamed to bg.jpg but it is deleted Did you see that I've changed the command in the script? It must be COPYFILE. (and not MOVEFILE, obviously) LORBY-SI
March 10, 20242 yr Author no better if I run the script with the test button it works but when loading the plane the AFR.jpg file is renamed to bg.jpg but it is deleted
March 10, 20242 yr Author it works very well remains to delete the bg.jpg file after loading the plane
March 10, 20242 yr Commercial Member 5 minutes ago, ptimale said: remains to delete the bg.jpg file after loading the plane Why do you want to do that? COPYFILE will overwrite it, when it can. When/if the file is locked by the Fenix process, you cannot delete it either. Anyway, on the AAO RPN editor there is a button called "Insert AAO cmd" where you can get all the special RPN commands that only exist in AAO. And use the AAO manual (click on the grey question mark button at the top of the AAO windows), everything is in there. Like for example "(DELETEFILE:xxxx)" Edited March 10, 20242 yr by Lorby_SI LORBY-SI
March 10, 20242 yr Author Why do you want to do that? COPYFILE will overwrite it, when it can. When/if the file is locked by the Fenix process, you cannot delete it either. no the file is not locked but thank you for your time I will look congratulations again for your help
March 10, 20242 yr Commercial Member 22 minutes ago, ptimale said: Why do you want to do that? COPYFILE will overwrite it, when it can. When/if the file is locked by the Fenix process, you cannot delete it either. no the file is not locked but thank you for your time I will look congratulations again for your help I'm sorry, but I am really lost. I don't understand the problem that you are seeing, what that "conflict" is supposed to be or what process you are following with your steps exactly. It seems to me that even the point when "my" script is executed is not when I thought that it would run. I'm afraid that this makes it impossible to suggest any code. LORBY-SI
March 10, 20242 yr Author here is the complete code for anyone who wants to do the same thing copy your images to the folder C:\ProgramData\Fenix\FenixSim A320\efb\img you must first load a wallpaper with the name bg.jpg see the procedure on the Fenix website rename your wallpaper with the icao airline code A big thank you to Olivier Mr. AAO for his help (my name is also Olivier :)) load the script with Aircraft Automated Script page 65 of the manual (LOAD_SIMBRIEF)·(SPLIT:2500)· 'C:\ProgramData\Fenix\FenixSim·A320\efb\img\'·(L:simbrief.general.icao_airline,·String)·scat·'.jpg'·scat·'C:\ProgramData\Fenix\FenixSim·A320\efb\img\bg.jpg'·(COPYFILE:%s1|%s2) (SPLIT:20000)· 'C:\ProgramData\Fenix\FenixSim·A320\efb\img\bg.jpg'·(DELETEFILE:%s1)· Edited March 10, 20242 yr by ptimale
March 16, 20242 yr I wonder if I'm doing something wrong. I'm running the script and it indeed identifies the code and creates a correct copy named bg.jpg. However, the efb screen itself does not refresh from the default background AND a few seconds after running the script the bg.jpg is deleted. Any clue to what went wrong?
March 16, 20242 yr Commercial Member 43 minutes ago, ha5mvo said: I wonder if I'm doing something wrong. I'm running the script and it indeed identifies the code and creates a correct copy named bg.jpg. However, the efb screen itself does not refresh from the default background AND a few seconds after running the script the bg.jpg is deleted. Any clue to what went wrong? Sorry, but I'm not doing any of that myself. Please consider sending @ptimale a personal message. LORBY-SI
March 16, 20242 yr Author Hi before using the script, you must load a wallpaper with an image called bg.jpg you will see that by default it is automatically saved in the folder C:\ProgramData\Fenix\FenixSim·A320\efb\img\ it is this image that is called up each time the plane is loaded
March 16, 20242 yr 5 hours ago, ptimale said: Hi before using the script, you must load a wallpaper with an image called bg.jpg you will see that by default it is automatically saved in the folder C:\ProgramData\Fenix\FenixSim·A320\efb\img\ it is this image that is called up each time the plane is loaded I do just that. What happens in practice though, is that the correct image is turned to into bg.jpg (corresponding with the simbrief data), however it fails to load and is automatically deleted after about 10 seconds leaving the background as it was and no bg.jpg in the folder. For some reason, the tablet won't refresh with the new bg file. If you bring up the remote tablet on http://localhost:8083/ - you will indeed get the new background showing up but not in the VC
March 17, 20242 yr Commercial Member 22 hours ago, ptimale said: Hi before using the script, you must load a wallpaper with an image called bg.jpg you will see that by default it is automatically saved in the folder C:\ProgramData\Fenix\FenixSim·A320\efb\img\ it is this image that is called up each time the plane is loaded For anyone interested, here is a solution using JScript in AAO. This script queries SimBrief on its own (supply your account name!), so no need to use (LOAD_SIMBRIEF): (I still don't understand why you are deleting the bg.jpg file?) (WSH:jscript|AaoEntry) function AaoEntry(){ // your SimBrief user name goes here var sbuser = 'yourusername'; // query SimBrief var xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP"); var commandStr = "https://www.simbrief.com/api/xml.fetcher.php?username=" + sbuser; xmlHttpReq.open("POST", commandStr, false); xmlHttpReq.send(); var content = xmlHttpReq.responseText; // load the resoponse XML into a DOM structure var dom = new ActiveXObject("msxml2.DOMDocument.6.0"); dom.async = false; dom.loadXML(content); // query the airline icao var objNodeList = dom.documentElement.selectNodes("general/icao_airline"); if (objNodeList && objNodeList.length > 0){ // if it exists, copy the file var acIcao = "" + objNodeList[0].text; var srcImgName = "C:\\ProgramData\\Fenix\\FenixSim A320\\efb\\img\\" + acIcao + ".jpg"; var trgImgName = "C:\\ProgramData\\Fenix\\FenixSim A320\\efb\\img\\bg.jpg"; var fso = new ActiveXObject("Scripting.FileSystemObject"); fso.CopyFile(srcImgName, trgImgName, true); // delete the target file after 20 seconds (why?) AaoCmd.sleep(20000); fso.DeleteFile(trgImgName, true); } } LORBY-SI
Archived
This topic is now archived and is closed to further replies.